Debug Pytorch: RuntimeError: CUDA error: device-side assert triggered
生活随笔
收集整理的這篇文章主要介紹了
Debug Pytorch: RuntimeError: CUDA error: device-side assert triggered
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
報錯信息
RuntimeError: CUDA error: device-side assert triggered /pytorch/aten/src/THC/THCTensorScatterGather.cu:188: void THCudaTensor_scatterFillKernel(TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, Real, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = -1]: block: [31,0,0], thread: [100,0,0] Assertion `indexValue >= 0 && indexValue < tensor.sizes[dim]` failed. /pytorch/aten/src/THC/THCTensorScatterGather.cu:188: void THCudaTensor_scatterFillKernel(TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, Real, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = -1]: block: [30,0,0], thread: [162,0,0] Assertion `indexValue >= 0 && indexValue < tensor.sizes[dim]` failed. /pytorch/aten/src/THC/THCTensorScatterGather.cu:188: void THCudaTensor_scatterFillKernel(TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, Real, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = -1]: block: [32,0,0], thread: [290,0,0] Assertion `indexValue >= 0 && indexValue < tensor.sizes[dim]` failed.解決
檢查label中是否有-1,或者label中有大于num_classes的數。label更新無誤后可解決問題
其他解決方法,嘗試運行時加上:
聯系方式
公眾號搜索:YueTan
總結
以上是生活随笔為你收集整理的Debug Pytorch: RuntimeError: CUDA error: device-side assert triggered的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SpringMVC参数的传递——接收Li
- 下一篇: Mybatis源码分析之(三)mappe