-
Notifications
You must be signed in to change notification settings - Fork 243
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
Got an unexpected keyword argument 'use_sde' when passing behavioural cloning policy to PPO from SB3 #781
Comments
Hi, I had the same error trying to retrain a policy with PPO after Behaviour Cloning. Actually, the problem is here : So when instantiating PPO with sb3, you should pass the policy class you want to use (which should inherit from ActorCriticPolicy). For example : This should work for instantiating the PPO. However, I am not sure how you should load the pre-trained policy, I could not find the right way to do it in stable-baselines3 (I tried Hope it helps somehow. Let me know if you find the right way to load a pre-trained policy with PPO algorithm 👍 |
For those who stumble across this issue, the
|
I had issue with saving and loading BC models and the below worked for me
|
I followed the above method mentioned by @yojul to load a BC model in SB3. Can @AlexGisi, @yojul or @JkAcktuator share how you overcome this issue ?
|
Hi @saeed349!.
I hope that it will helpful. |
Bug description
Hello,
I want to pass the policy learned from behavioural cloning in imitation library to PPO, I thought it would be successful since they are both from ActorCriticPolicy class, however it doesn't work as I expected.
Steps to reproduce
The error is:
Traceback (most recent call last):
File "agent/main.py", line 142, in
model = PPO(policy=bc_trainer.policy, env=env, verbose=1, device = 'cuda')
File "/home/repos/stable-baselines3/stable_baselines3/ppo/ppo.py", line 164, in init
self._setup_model()
File "/home/repos/stable-baselines3/stable_baselines3/ppo/ppo.py", line 167, in _setup_model
super()._setup_model()
File "/home/repos/stable-baselines3/stable_baselines3/common/on_policy_algorithm.py", line 120, in _setup_model
self.policy = self.policy_class( # pytype:disable=not-instantiable
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'use_sde'
Environment
The text was updated successfully, but these errors were encountered: