Skip to content
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

Unable to run enjoy.py #262

Open
jakefoster954 opened this issue Feb 3, 2021 · 1 comment
Open

Unable to run enjoy.py #262

jakefoster954 opened this issue Feb 3, 2021 · 1 comment

Comments

@jakefoster954
Copy link

jakefoster954 commented Feb 3, 2021

Main.py successfully completes for the reacher environment however I am unable to run enjoy.py. The window opens but then I get a runtime error:

RuntimeError: Tensor for argument #2 'mat1' is on CPU, but expected it to be on GPU (while checking arguments for addmm)

Any advice on how to fix this would be appreciated. See full error message below.

It is worth noting this was run on the version of master before baselines was replaced by stablebaselines.

Creating window glfw
Traceback (most recent call last):
File "enjoy.py", line 80, in
obs, recurrent_hidden_states, masks, deterministic=args.det)
File ".../pytorch-a2c-ppo-acktr-gail/a2c_ppo_acktr/model.py", line 55, in act
value, actor_features, rnn_hxs = self.base(inputs, rnn_hxs, masks)
File "/home/..../anaconda3/envs/pytorch-a2c/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "..../pytorch-a2c-ppo-acktr-gail/a2c_ppo_acktr/model.py", line 226, in forward
hidden_critic = self.critic(x)
File "..../anaconda3/envs/pytorch-a2c/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "..../anaconda3/envs/pytorch-a2c/lib/python3.7/site-packages/torch/nn/modules/container.py", line 117, in forward
input = module(input)
File "..../anaconda3/envs/pytorch-a2c/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "..../anaconda3/envs/pytorch-a2c/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 93, in forward
return F.linear(input, self.weight, self.bias)
File "..../anaconda3/envs/pytorch-a2c/lib/python3.7/site-packages/torch/nn/functional.py", line 1690, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: Tensor for argument #2 'mat1' is on CPU, but expected it to be on GPU (while checking arguments for addmm)

@ikostrikov
Copy link
Owner

Fixed in b25c006

Could you verify that the fix works for you as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants