DLR-RM / rl-trained-agents

A collection of pre-trained RL agents using Stable Baselines3
https://huggingface.co/sb3
MIT License
105 stars 25 forks source link

Cannot load off-policy trained agents #22

Open DavideZFC opened 2 years ago

DavideZFC commented 2 years ago

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 commented 2 years ago

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