1 year ago
#69678
Ashish Kumar
PPO Model not loading
I have trained an agent on colab using openAI gym and stable_baselines(PPO) but when I downloaded the model to local computer I can't load the model and it is throwing error.
model = PPO.load(TRAINED_MODEL_PATH
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Input In [68], in <module>
----> 1 model = PPO.load(TRAINED_MODEL_PATH)
File ~/rl/lib/python3.8/site-packages/stable_baselines3/common/base_class.py:717, in BaseAlgorithm.load(cls, path, env, device, custom_objects, print_system_info, force_reset, **kwargs)
715 model.__dict__.update(data)
716 model.__dict__.update(kwargs)
--> 717 model._setup_model()
719 # put state_dicts back in place
720 model.set_parameters(params, exact_match=True, device=device)
File ~/rl/lib/python3.8/site-packages/stable_baselines3/ppo/ppo.py:158, in PPO._setup_model(self)
155 super(PPO, self)._setup_model()
157 # Initialize schedules for policy/value clipping
--> 158 self.clip_range = get_schedule_fn(self.clip_range)
159 if self.clip_range_vf is not None:
160 if isinstance(self.clip_range_vf, (float, int)):
File ~/rl/lib/python3.8/site-packages/stable_baselines3/common/utils.py:91, in get_schedule_fn(value_schedule)
89 value_schedule = constant_fn(float(value_schedule))
90 else:
---> 91 assert callable(value_schedule)
92 return value_schedule
AssertionError:
python
deep-learning
reinforcement-learning
0 Answers
Your Answer