深度学习代码_Bug
|
本节将自己所遇到的bug问题及解决方法记录下来。更新ing...... |
目录
1.AttributeError: 'Model' object has no attribute 'module'
在构建如model = Model()之后,调用model.module失败,最终发现,是因为nvidia-smi失败缘故, 即没有无法运行cuda,因为本机之前内核更新失败过。然而这份代码pycharm竟然不是提示cuda失败(我先调用的cuda),震惊!
解决方法:降低内核
2. 报错 cuda error:device-side assert triggered 、CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
2.1. 先用下面这个进行准确定位. 放在代码运行最前面
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
2.2. 如果还是不清晰报错,可以改用CPU运行,即可准确找出错误。
吾志所向,一往无前;愈挫愈勇,再接再厉。

浙公网安备 33010602011771号