[Linux服务器 错误] TypeError: can‘t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor

这一错误出现的原因是对之前的cuda中的张量又使用numpy进行计算。检查代码使用A.data.cpu().numpy()变换一下即可继续

猜你喜欢

转载自blog.csdn.net/qq_45347185/article/details/108965347