2021
03-05
03-05
解决pytorch 数据类型报错的问题
pytorch报错:RuntimeError:ExpectedobjectoftypeVariable[torch.LongTensor]butfoundtypeVariable[torch.cuda.ByteTensor]forargument#1‘argument1'解决方法:pytorch框架在存储labels时,采用LongTensor来存储,所以在一开始dataset返回label时,就要返回与LongTensor对应的数据类型,即numpy.int64补充:使用pytorch遇到的各种问题及解决方案自己在使用pytorch遇到的各种问题及解决方案:RuntimeError:Expected...
继续阅读 >