TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first
I had the same issue, a answer.cpu() did not work for me but answer.to('cpu')... did work for me.
TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
learned_pred = euclidean_distances(answer.cpu().data.numpy(), predicates_emb).argmin(axis=1)
The type error is raised in the above line of code I used .cpu() so I cannot understand why..
How can I solve this problem?