gyx0303 2021-02-05 10:50 采纳率: 0%
浏览 454

pytorch报错,跑完第一个epoch报这个错误,求大佬指导

C:/w/1/s/tmp_conda_3.7_100118/conda/conda-bld/pytorch_1579082551706/work/aten/src/THC/THCTensorScatterGather.cu:100: block: [0,0,0], thread: [2,0,0] Assertion `indexValue >= 0 && indexValue < src.sizes[dim]` failed.
C:/w/1/s/tmp_conda_3.7_100118/conda/conda-bld/pytorch_1579082551706/work/aten/src/THC/THCTensorScatterGather.cu:100: block: [0,0,0], thread: [3,0,0] Assertion `indexValue >= 0 && indexValue < src.sizes[dim]` failed.
C:/w/1/s/tmp_conda_3.7_100118/conda/conda-bld/pytorch_1579082551706/work/aten/src/THC/THCTensorScatterGather.cu:100: block: [0,0,0], thread: [9,0,0] Assertion `indexValue >= 0 && indexValue < src.sizes[dim]` failed.
C:/w/1/s/tmp_conda_3.7_100118/conda/conda-bld/pytorch_1579082551706/work/aten/src/THC/THCTensorScatterGather.cu:100: block: [0,0,0], thread: [12,0,0] Assertion `indexValue >= 0 && indexValue < src.sizes[dim]` failed.
Traceback (most recent call last):
  File "D:/桌面/代码/resnet18_train.py", line 117, in <module>
    loss.backward()
  File "D:\ProgramData\Anaconda3\lib\site-packages\torch\tensor.py", line 195, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "D:\ProgramData\Anaconda3\lib\site-packages\torch\autograd\__init__.py", line 99, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: CUDA error: device-side assert triggered

  • 写回答

3条回答 默认 最新

  • BryceRui 2021-02-05 11:15
    关注

    是不是标签有负数值  标签是[0,0,0,1]这样的数组或者0,1,2,3这样的形式哦

    评论

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?