在使用Pytorch时我遇到如下错误
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
出错代码如下
out = out.detach().numpy()
如下修改就可以
out = out.detach().cpu().numpy()
在使用Pytorch时我遇到如下错误
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
出错代码如下
out = out.detach().numpy()
如下修改就可以
out = out.detach().cpu().numpy()