TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Created by: Gaoee
When I run the QuickStart of pytorch examples, I get this error: Traceback (most recent call last): File "train.py", line 76, in main() File "train.py", line 59, in main obs_list, action_list, reward_list = run_episode(env, agent) File "train.py", line 33, in run_episode action = agent.sample(obs) File "/home/exp/Codes/PARL/benchmark/torch/QuickStart/cartpole_agent.py", line 44, in sample prob = prob.data.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Is it the bug of the code? Thanks!