用pytorch把numpy转成tensor的时候,遇到了这个报错:“RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.DoubleTensor”。
最终解决办法如下:
mask_tsor=torch.from_numpy(mask_np).float()
mask_tsor=mask_tsor.cuda()
用pytorch把numpy转成tensor的时候,遇到了这个报错:“RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.DoubleTensor”。
最终解决办法如下:
mask_tsor=torch.from_numpy(mask_np).float()
mask_tsor=mask_tsor.cuda()