MushroomRL / mushroom-rl

Python library for Reinforcement Learning.
MIT License
803 stars 145 forks source link

Save and Load Agent for the Second Time #130

Closed PuzeLiu closed 11 months ago

PuzeLiu commented 1 year ago

There is a problem when saving and loading the agent for the second time. The issue raises when loading the optimizer in the _target_critic_approximator in SAC and target_approximator in DQN. File "/home/puze/miniconda3/envs/py38/lib/python3.8/site-packages/torch/optim/adam.py", line 61, in __setstate__ step_is_tensor = (len(state_values) != 0) and torch.is_tensor(state_values[0]['step'])

boris-il-forte commented 1 year ago

I'll try to find a solution to this issue as soon as possible. Thanks for pointing out.

boris-il-forte commented 11 months ago

The issue should be fixed now. let me know if this solution introduces any problems (it seems not)