You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, while trying to save locally on my filesystem a trajectories list I discovered that the save method of the serialize module is not working as expected, at list as presented in the docs.
When calling serialize.save("my_path", my_trajectories), the code fails with the following trace:
Downloading a pretrained expert.
Sampling expert transitions.
Traceback (most recent call last):
File "/home/alexpalms/imitation_learning/imitation_quickstart.py", line 42, in <module>
transitions = sample_expert_transitions()
File "/home/alexpalms/imitation_learning/imitation_quickstart.py", line 38, in sample_expert_transitions
serialize.save(rollouts_path, rollouts)
File "/home/alexpalms/miniconda3/envs/imitation/lib/python3.9/site-packages/imitation/data/serialize.py", line 25, in save
huggingface_utils.trajectories_to_dataset(trajectories).save_to_disk(p)
File "/home/alexpalms/miniconda3/envs/imitation/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1515, in save_to_disk
fs, _ = url_to_fs(dataset_path, **(storage_options or {}))
File "/home/alexpalms/miniconda3/envs/imitation/lib/python3.9/site-packages/fsspec/core.py", line 383, in url_to_fs
chain = _un_chain(url, kwargs)
File "/home/alexpalms/miniconda3/envs/imitation/lib/python3.9/site-packages/fsspec/core.py", line 323, in _un_chain
if "::" in path
I also found the fix (or better workaround) but since I just came across this lib I am not sure if it is the best way to handle it, as it might hide some compatibility issues with HF library. To fix it, I did the following:
I casted to string the path in this link:
Bug description
Hi all, while trying to save locally on my filesystem a trajectories list I discovered that the save method of the serialize module is not working as expected, at list as presented in the docs.
When calling
serialize.save("my_path", my_trajectories)
, the code fails with the following trace:I also found the fix (or better workaround) but since I just came across this lib I am not sure if it is the best way to handle it, as it might hide some compatibility issues with HF library. To fix it, I did the following:
I casted to string the path in this link:
imitation/src/imitation/data/serialize.py
Line 23 in a8b079c
so from this:
it became this:
Steps to reproduce
To reproduce the problem you can execute this code, a customization of your example:
Environment
pip freeze --all
:Let me know if you want me to create a PR and if you have suggestions to improve that handling.
Looking forward to receive your feedback
The text was updated successfully, but these errors were encountered: