pytorch RuntimeError: cuda runtime error (59)

pytorch RuntimeError: cuda runtime error (59)

最后发现是自己类别设错了,对应的可以作为参考,是不是自己设置的label数量和数据量不对称所造成的

Traceback (most recent call last):
  File "./main.py", line 180, in 
    main(args)
  File "./main.py", line 144, in main
    train_loss, train_acc = train(model, train_loader, optimizer, criterion, epoch, args)
  File "./main.py", line 78, in train
    loss.backward()
  File "/home/k/SoftWare/anaconda2/envs/python3/lib/python3.6/site-packages/torch/tensor.py", line 93, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/k/SoftWare/anaconda2/envs/python3/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_1532581333611/work/aten/src/THC/generic/THCTensorMath.cu:26

 

你可能感兴趣的:(pytorch,error)