pytorch-BUG记录

BUG1:RuntimeError: cuda runtime error (59) 

错误信息如下所示:

THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1549628766161/work/aten/src/THC/generic/THCTensorMath.cu line=24 error=59 : device-side assert triggered
Traceback (most recent call last):
  File "/home/songyanbei/bilinear-cnn2/src/test.py", line 40, in 
    loss.backward()
  File "/home/songyanbei/anaconda3/lib/python3.6/site-packages/torch/tensor.py", line 102, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/songyanbei/anaconda3/lib/python3.6/site-packages/torch/autograd/__init__.py", line 90, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: cuda runtime error (59) : device-side assert triggered at /opt/conda/conda-bld/pytorch_1549628766161/work/aten/src/THC/generic/THCTensorMath.cu:24

发现在计算loss的时候报错了,于是查看数据集和网络结构,发现最后一层的fc的输出类别小于数据集中的类别,将二者统一后错误消除

你可能感兴趣的:(pytorch-BUG记录)