-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Enhancement] Support for fallbacks when loading cloudpickle items fail #172
Comments
From what I saw the problem I encountered is with the learning rate and clip ratio schedulers (for PPO), in the particular case where a constant scheduler is created using In general I think the ideas for other fallbacks are good because it allows the user more flexibility. |
I started a branch for schedulers. I think we should not subclass from PyTorch's
The third point would require to slightly modify |
I wouldn't just focus on schedules though, as other objects are stored as pickled objects (no easy alternative). I am not sure having non-pickled versions of all objects is possible, and it would not be easy at the very least. I'd focus on the fallback tools to help reconstructing models if loading fails (part of the reason why currently the saved model contains some description of the pickled object). However if you can find something that could be used to achieve less-brittle serialization I am all ears! |
this can create a file from model, but it's too large:
then you can save and load with dumped model without any error:
this sometimes gives cuda error, if you saw that, modify |
as a follow-up, I added support for custom objects here: #336 |
Related issue #171
As seen in #171, cloudpickle/pickle can easily fail when transferring models between Python versions (and in case some other shenanigans). There is currently no way to address this issue as loading of model tries to un-pickle all pickle objects and does not catch errors.
Two suggestions to deal with this, both of which would be nice to have:
custom_objects
dictionary (similar to what we had in SB2), which will override any objects read from file. This could be used to even prevent loading the item from the file, in which case all JSON-ed items can be used as before.set_parameters
function to only load parameters from the file but not thedata
objects (which include pickled items). This was included in SB2.@ManifoldFR If you had other suggestions please feel free to throw them here :)
The text was updated successfully, but these errors were encountered: