can't convert cuda:0 device type tensor to numpy
x是list,list内容是tensor cuda
代码:
x = np.array(x)
则会报错:
方法1:
pip install numpy==1.19.5
方法2:
for循环,把x的内容 cpu().numpy()
x= [a.cpu().numpy() for a in x]
can't convert cuda:0 device type tensor to numpy
x是list,list内容是tensor cuda
代码:
x = np.array(x)
则会报错:
方法1:
pip install numpy==1.19.5
方法2:
for循环,把x的内容 cpu().numpy()
x= [a.cpu().numpy() for a in x]