Skip to content
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

Cannot load off-policy trained agents #22

Open
DavideZFC opened this issue Oct 21, 2022 · 1 comment
Open

Cannot load off-policy trained agents #22

DavideZFC opened this issue Oct 21, 2022 · 1 comment

Comments

@DavideZFC
Copy link

I have tried to load the trained agent with these lines

from stable_baselines3 import SAC
agent = SAC.load("BipedalWalker-v3.zip")

Where of course the file "BipedalWalker-v3.zip" comes from here.

I get this error:
AttributeError: Can't get attribute 'TrainFreq' on <module 'stable_baselines3.common.type_aliases' from 'C:\\Users\\Davide\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\stable_baselines3\\common\\type_aliases.py'>

Like it is incompatible with some file of stable_baselines_3. Note that the same problem holds for other off-policy algorithms (like DDPG) but not for on-policy ones (like PPO).

@araffin
Copy link
Member

araffin commented Oct 21, 2022

I have tried to load the trained agent with these lines

You need to use latest SB3 version and I would also recommend using the RL Zoo for loading pretrained agents, see instructions in https://huggingface.co/sb3/sac-BipedalWalker-v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants