当前位置:   article > 正文

PyTorch报错:RuntimeError: CUDA error: device-side assert triggered at /pytorch/aten/src/THC/generic_runtimeerror: cuda runtime error (710) : device-si

runtimeerror: cuda runtime error (710) : device-side assert triggered at

训练模型报错

RuntimeError: cuda runtime error (710) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorMath.cu:29
  • 1

问题解决

原因:标签(label)越界,一般从0开始

方法:更改你的标签值,从0开始

target_names = ['__label__1', '__label__2', '__label__3', '__label__4', '__label__5']
    for i in range(len(questlist)):
        if i < len(questlist):
            for j in range(len(attrlist)):
                if j < len(attrlist):
                    if attr_names[j] in attrlist[i]:
                        label = target_names[j]
                        line = " ".join(jieba.cut(questlist[i])) + "\t" + str(int(label[-1])-1) ## 标签值减1
                        linelist.append(line)
                        break
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  line = " ".join(jieba.cut(questlist[i])) + "\t" + str(int(label[-1])-1) ## 标签值减1
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/89134
推荐阅读
相关标签
  

闽ICP备14008679号