RuntimeError: cuda runtime error (59) : device-side assert triggered when running transfer_learning_

2820 단어

RuntimeError: cuda runtime error (59) : device-side assert triggered when running transfer_learning_tutorial 

/py/conda-bld/pytorch_1490981920203/work/torch/lib/THCUNN/ClassNLLCriterion.cu:52: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [0,0,0] Assertion `t >= 0 && t < n_classes` failed.
/py/conda-bld/pytorch_1490981920203/work/torch/lib/THCUNN/ClassNLLCriterion.cu:52: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [1,0,0] Assertion `t >= 0 && t < n_classes` failed.
/py/conda-bld/pytorch_1490981920203/work/torch/lib/THCUNN/ClassNLLCriterion.cu:52: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [2,0,0] Assertion `t >= 0 && t < n_classes` failed.
/py/conda-bld/pytorch_1490981920203/work/torch/lib/THCUNN/ClassNLLCriterion.cu:52: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [3,0,0] Assertion `t >= 0 && t < n_classes` failed.
THCudaCheck FAIL file=/py/conda-bld/pytorch_1490981920203/work/torch/lib/THCUNN/generic/ClassNLLCriterion.cu line=83 error=59 : device-side assert triggered
Traceback (most recent call last):
  File "transfer_learning_tutorial.py", line 289, in 
    model = train_model(model, criterion, optim_scheduler_ft, num_epochs=25)
  File "transfer_learning_tutorial.py", line 180, in train_model
    loss = criterion(outputs, labels)
  File "python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "python2.7/site-packages/torch/nn/modules/loss.py", line 313, in forward
    self.weight, self.size_average)
  File "python2.7/site-packages/torch/nn/functional.py", line 509, in cross_entropy
    return nll_loss(log_softmax(input), target, weight, size_average)
  File "python2.7/site-packages/torch/nn/functional.py", line 477, in nll_loss
    return f(input, target)
  File "python2.7/site-packages/torch/nn/_functions/thnn/auto.py", line 41, in forward
    output, *self.additional_args)
RuntimeError: cuda runtime error (59) : device-side assert triggered at /py/conda-bld/pytorch_1490981920203/work/torch/lib/THCUNN/generic/ClassNLLCriterion.cu:83

 
왜냐하면 손실을 계산할 때 라벨은 0에서 시작하지 않기 때문이다.pytorch는 반드시 0-n의 라벨이어야 틀리지 않는다
 

좋은 웹페이지 즐겨찾기