使用Pytorch进行训练的时候,会出现:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
THCudaCheck FAIL file=/pytorch/aten/src/THC/generic/THCTensorMath.cu line=26 error=59 : device-side assert triggered /pytorch/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [1,0,0] Assertion `t >= 0 && t < n_classes` failed. /pytorch/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [6,0,0] Assertion `t >= 0 && t < n_classes` failed. /pytorch/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [7,0,0] Assertion `t >= 0 && t < n_classes` failed. Traceback (most recent call last): File "/home/ubuntu/bigdisk/part1/Gabor_CNN/demo/RS19.py", line 163, in <module> train(epoch+1) File "/home/ubuntu/bigdisk/part1/Gabor_CNN/demo/RS19.py", line 133, in train loss.backward() File "/usr/local/python3/lib/python3.6/site-packages/torch/tensor.py", line 107, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/usr/local/python3/lib/python3.6/site-packages/torch/autograd/__init__.py", line 93, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorMath.cu:26 |
解决方法:
这种情况,一般是因为训练标签的问题。
本文最后更新于2019年12月20日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
试试看看行不行
非常好
能否给个联系方式,交流一下请教一下
我感觉我解决了这个Netframework的问题了,安装好要求重启,重启以后安装deepl,但是又出问题了,显示there was an error while installing the appl
请您详细教我一下,怎么下载安装您说的这个.NET
又来麻烦您了,我下载好了,安装的时候提示:Failed to install the .NET Framework, try installing the latest version manuall
win7旗舰版
感谢回复。不是直接点就能安装啊,下载下来的是个压缩文件,解压后有6个内容:.background、.HFS+Private Directory Data、[HFS+Private Data]、Deep