huggingface / huggingface_sb3

Additional code for Stable-baselines3 to load and upload models from the Hub.
77 stars 23 forks source link

Case 1: I want to download a model from the Hub, model = PPO.load() has a bug #21

Closed zhangpaipai closed 1 year ago

zhangpaipai commented 1 year ago

when I use the demo code of Case 1: I want to download a model from the Hub, PPO.load(checkpoint) has an error: File "/home/pi/桌面/hit_master_bishe_dmc/expert.py", line 14, in model = PPO.load(checkpoint) File "/home/pi/anaconda3/envs/pytorch/lib/python3.9/site-packages/stable_baselines3/common/base_class.py", line 717, in load model._setup_model() File "/home/pi/anaconda3/envs/pytorch/lib/python3.9/site-packages/stable_baselines3/ppo/ppo.py", line 155, in _setup_model super(PPO, self)._setup_model() File "/home/pi/anaconda3/envs/pytorch/lib/python3.9/site-packages/stable_baselines3/common/on_policy_algorithm.py", line 106, in _setup_model self._setup_lr_schedule() File "/home/pi/anaconda3/envs/pytorch/lib/python3.9/site-packages/stable_baselines3/common/base_class.py", line 277, in _setup_lr_schedule self.lr_schedule = get_schedule_fn(self.learning_rate) File "/home/pi/anaconda3/envs/pytorch/lib/python3.9/site-packages/stable_baselines3/common/utils.py", line 91, in get_schedule_fn assert callable(value_schedule) AssertionError

qgallouedec commented 1 year ago

Probably a duplicate of https://github.com/DLR-RM/stable-baselines3/issues/1131

Upgrading sb3 to v1.7+ should fix it.