huggingface / huggingface_sb3

Additional code for Stable-baselines3 to load and upload models from the Hub.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

zhangpaipai opened this issue · comments

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

Probably a duplicate of DLR-RM/stable-baselines3#1131

Upgrading sb3 to v1.7+ should fix it.