Hi.
I am Mikhail.
I am training my model but error is occurred as follows:
C:/w/1/s/tmp_conda_3.7_104508/conda/conda-bld/pytorch_1572950778684/work/aten/src/THCUNN/SpatialClassNLLCriterion.cu:104: block: [0,0,0], thread: [903,0,0] Assertion  t >= 0 && t < n_classes  failed.
THCudaCheck FAIL file=…\aten\src\THC\THCCachingHostAllocator.cpp line=278 error=710 : device-side assert triggered
File “c:\Users\OCR Labs\Documents\ERFNet-CULane-PyTorch\train_erfnet.py”, line 173, in train
loss_exist = criterion_exist(output_exist, target_exist_var)
File “C:\Users\OCR Labs\Anaconda3\envs\torch-env\lib\site-packages\torch\nn\modules\module.py”, line 541, in call
result = self.forward(*input, **kwargs)
File “C:\Users\OCR Labs\Anaconda3\envs\torch-env\lib\site-packages\torch\nn\modules\loss.py”, line 601, in forward
reduction=self.reduction)
File “C:\Users\OCR Labs\Anaconda3\envs\torch-env\lib\site-packages\torch\nn\functional.py”, line 2116, in binary_cross_entropy_with_logits
return torch.binary_cross_entropy_with_logits(input, target, weight, pos_weight, reduction_enum)
RuntimeError: CUDA error: device-side assert triggered
I am going to get 5 classes as a output class, so i have set 5 class.
My error is occured in following command line.
loss = criterion(torch.nn.functional.log_softmax(output, dim=1), target_var)
here output tensor is tensor([[0.4826, 0.4970, 0.4989, 0.4563, 0.5411]]) and target_var is tensor([[1., 1.,1.,1.,1.]])
How can i fix this issue? Thank you very much!