TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first
The conversion from variable answer is true. Therefore, I think the problem may stay in the variable predicates_emb.
Can you check if var predicates_emb is tensor or not. If it is, you should convert it to numpy array.
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?