ikostrikov/pytorch-a2c-ppo-acktr-gail

Unable to run enjoy.py

jakefoster954 opened this issue · 1 comments

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)

Fixed in b25c006

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