报错信息

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.

解决

  1. 检查label中是否有-1,或者label中有大于num_classes的数。label更新无误后可解决问题

  2. 其他解决方法,尝试运行时加上:

CUDA_LAUNCH_BLOCKING=1 python train.py

联系方式

公众号搜索:YueTan

Debug Pytorch: RuntimeError: CUDA error: device-side assert triggered相关推荐

  1. [debug] RuntimeError: CUDA error: no kernel image is available for execution on the device

    问题描述 运行程序时出现报错: RuntimeError: CUDA error: no kernel image is available for execution on the device ( ...

  2. PyTorch报错:RuntimeError: CUDA error: device-side assert triggered at /pytorch/aten/src/THC/generic

    训练模型报错 RuntimeError: cuda runtime error (710) : device-side assert triggered at /pytorch/aten/src/TH ...

  3. RuntimeError: cuda runtime error (59) : device-side assert triggered

    问题 在训练 Transformer 的过程中,pytorhc出现的问题:RuntimeError: cuda runtime error (59) : device-side assert trig ...

  4. Faster rcnn 训练coco2017数据报错 RuntimeError: CUDA error: device-side assert triggered

    Faster rcnn 训练coco2017数据报错 RuntimeError: CUDA error: device-side assert triggered 使用faster rcnn训练自己的 ...

  5. RTX 3090运行报错:RuntimeError: CUDA error: no kernel image is available for execution on the device

    RuntimeError: CUDA error: no kernel image is available for execution on the device 安装适用于GeForce RTX ...

  6. 已解决RuntimeError: CUDA error: device-side assert triggered异常的正确解决方法,亲测有效!!!

    已解决RuntimeError: CUDA error: device-side assert triggered异常的正确解决方法,亲测有效!!! 文章目录 报错问题 解决方法 福利 报错问题 粉丝 ...

  7. RuntimeError: CUDA error: no kernel image is available for execution on the device

    导致的原因一般都是显卡算力和cuda或者torch版本不匹配 比如在conda中安装的pytorch=1.5.0 cuda=10.2 错误:RuntimeError: CUDA error: no k ...

  8. 出现错误(已解决)RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA ker

    出现问题(已解决)RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA ker ...

  9. 完美解决-RuntimeError: CUDA error: device-side assert triggered

    网上的解决方案意思是对的,但并没有给出相应的实际解决方法: 问题描述: 当使用ImageFolder方式构建数据集的时候: train_data = torchvision.datasets.Imag ...

最新文章

  1. matlab 通过矩阵变换使图像旋转平移_图像的几何变换
  2. About A Scam
  3. 荣耀com.huawei.android,荣耀阅读(com.huawei.hnreader) - 8.1.0.309 - 应用 - 酷安
  4. iphone5新尺寸
  5. FFmpeg流媒体处理-收流与推流
  6. Win10解决无法访问其他机器共享的问题
  7. 【转】C++类的sizeof大小
  8. oracle11g异机备份,tsm oracle11g rac环境异机恢复报错(或者搭建dg)
  9. Net设计模式实例之观察者模式(Observer Pattern)
  10. 检测远程主机上的某个端口是否开启——telnet命令
  11. 智能优化算法之免疫算法(IA)
  12. 蓝牙AVRCP协议常见数据包分析
  13. 自定义IE地址栏图标
  14. 乐高ev3搭建图_你所不知道的乐高EV3发展史
  15. 图的广度优先搜索和深度优先搜索
  16. 【观察】华为云:决胜拉美市场“正当时”,做出海企业的“好帮手”
  17. linux系统上安装微信(Ubuntu/Debian 微信安装)
  18. Spring Boot:四大神器之CLI
  19. Suggestion: use tools:overrideLibrary=xxx.xxx.xxx to force usage
  20. hin2vec 异质信息网络表示学习 个人笔记

热门文章

  1. ansible-01
  2. MySQL Router实现MySQL的读写分离
  3. error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MTd_StaticDebug”不匹配值“MDd_DynamicDebug...
  4. STL 容器 与 数据结构
  5. 02 - Unit06:弹出对话框
  6. Java集合框架之ArrayList类
  7. 股市投资大师的股市投资名言
  8. 20165333第一次课堂测试补漏
  9. flask的日志输出current_app.logger.debug
  10. 爬虫+python3(网页图片)