-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Fix Minari tests #2419
[CI] Fix Minari tests #2419
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for owning this!
We now have multiple. The linter (pre-commit) is also unhappy. Lines 34 to 52 in 0326c41
|
Ups, my env was contaminated. |
After further analysis, the issue was with remote datasets lacking spaces, causing Minari to fall back to |
There seems to be another error in the CI now: |
# We rely on sorting the keys as v0 < v1 but if the version is greater than 9 this won't work | ||
total_keys = sorted(minari.list_remote_datasets()) | ||
assert not any( | ||
key[-2:] == "10" for key in total_keys | ||
), "You should adapt the Minari test scripts as some dataset have a version >= 10 and sorting will fail." | ||
total_keys_splits = [key.split("-") for key in total_keys] | ||
total_keys = sorted( | ||
minari.list_remote_datasets(latest_version=True, compatible_minari_version=True) | ||
) | ||
indices = torch.randperm(len(total_keys))[:20] | ||
keys = [total_keys[idx] for idx in indices] | ||
keys = [ | ||
key | ||
for key in keys | ||
if "=0.4" in minari.list_remote_datasets()[key]["minari_version"] | ||
] | ||
|
||
def _replace_with_max(key): | ||
key_split = key.split("-") | ||
same_entries = ( | ||
torch.tensor( | ||
[total_key[:-1] == key_split[:-1] for total_key in total_keys_splits] | ||
) | ||
.nonzero() | ||
.squeeze() | ||
.tolist() | ||
) | ||
last_same_entry = same_entries[-1] | ||
return total_keys[last_same_entry] | ||
|
||
keys = [_replace_with_max(key) for key in keys] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believed what changed is the order of _MINARI_DATASETS given the above modification.
The test work with kitchen
or antmaze
datasets as the observation space is a dictionary, while it doesn't work for pen
datasets.
I can change the code to test only a kitchen dataset or to work with the pen one.
I changed the preprocessing test to only use a dataset with Dict observation space. |
Description
With Minari 0.5.0 release, we regrouped dependencies to install only the required ones depending on user usage.
Moreover, we restructured the datasets to be hierarchical. This caused the
torch/rl
tests to fail; this PR should fix them.I changed the tests to rely on Minari for getting the last version of the datasets.
Also, Minari 0.5.0 adds support for Arrow datasets, I am happy to integrate it in
torch/rl
.Motivation and Context
Fixes failing CI due to new version of Minari.
Types of changes
Checklist