Problem: TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. GPU only problem.
Traceback (most recent call last):
File "train.py", line 274, in <module>
main()
File "train.py", line 216, in main
total_logging_policy = np.vstack(total_policy)
File "/home/deployer/.pyenv/versions/3.6.8/envs/general/lib/python3.6/site-packages/numpy/core/shape_base.py", line 234, in vstack
return _nx.concatenate([atleast_2d(_m) for _m in tup], 0)
File "/home/deployer/.pyenv/versions/3.6.8/envs/general/lib/python3.6/site-packages/numpy/core/shape_base.py", line 234, in <listcomp>
return _nx.concatenate([atleast_2d(_m) for _m in tup], 0)
File "/home/deployer/.pyenv/versions/3.6.8/envs/general/lib/python3.6/site-packages/numpy/core/shape_base.py", line 102, in atleast_2d
ary = asanyarray(ary)
File "/home/deployer/.pyenv/versions/3.6.8/envs/general/lib/python3.6/site-packages/numpy/core/numeric.py", line 553, in asanyarray
return array(a, dtype, copy=False, order=order, subok=True)
File "/home/deployer/.pyenv/versions/3.6.8/envs/general/lib/python3.6/site-packages/torch/tensor.py", line 450, in __array__
return self.numpy()
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
Problem: TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. GPU only problem.