You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/kavin/Documents/PycharmProjects/RL/Imitation/example.py", line 150, in <module>
bc_trainer.train(n_epochs=1)
File "/home/kavin/anaconda3/envs/PythonEnv/lib/python3.8/site-packages/imitation/algorithms/bc.py", line 495, in train
training_metrics = self.loss_calculator(self.policy, obs_tensor, acts)
File "/home/kavin/anaconda3/envs/PythonEnv/lib/python3.8/site-packages/imitation/algorithms/bc.py", line 130, in __call__
(_, log_prob, entropy) = policy.evaluate_actions(
File "/home/kavin/anaconda3/envs/PythonEnv/lib/python3.8/site-packages/stable_baselines3/common/policies.py", line 736, in evaluate_actions
log_prob = distribution.log_prob(actions)
File "/home/kavin/anaconda3/envs/PythonEnv/lib/python3.8/site-packages/stable_baselines3/common/distributions.py", line 292, in log_prob
return self.distribution.log_prob(actions)
File "/home/kavin/anaconda3/envs/PythonEnv/lib/python3.8/site-packages/torch/distributions/categorical.py", line 127, in log_prob
return log_pmf.gather(-1, value).squeeze(-1)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper_CUDA_gather)
It seems that it cannot train with a GPU. I got this error when I set the device to "cuda:0", but not when I set it to "cpu".
I get this error too. RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper_CUDA_gather)
It appears on call to train(), at least on two algos. dagger_trainer.train() and bc_trainer.train()
Bug description
It seems that it cannot train with a GPU. I got this error when I set the device to "cuda:0", but not when I set it to "cpu".
Steps to reproduce
Environment
pip freeze --all
:stable-baselines3==2.2.0
The text was updated successfully, but these errors were encountered: