BUG_1
RuntimeError: cuda runtime error (59) : device-side assert triggered at C:/w/1/s/tmp_conda_3.5_160740/conda/conda-bld/pytorch_1570810133449/work/aten/src\THC/generic/THCTensorMath.cu:26
问题原因:再用pytorch时进行损失值计算时,标签值应该再0-class_size-1内,所以标签值不能大于标签的个数。
解决方法:
在数据集类里面的def __getitem__(self, index):
函数中里面添加label处理,将label限制再范围内。比如我的标签是1-18,所以我再处理的时直接label=label-1
,就可以了。