注意:
pytorch1.8.1有坑,训练报错信息如下:

/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:142: operator(): block: [0,0,0], thread: [64,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed.
/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:142: operator(): block: [0,0,0], thread: [65,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed.
RuntimeError: CUDA error: device-side assert triggered

以上是我在cuda11.1的RTX3090服务器训练Faster-RCNN遇到的问题,网上都说大概率是数据集标签越界的问题,检查了一晚上代码和数据集,结果在原来的TiTan X机器训练(pytorch1.6.0)没有问题,果然是pytorch版本的问题。

之所以安装pytorch1.8.1,是因为pytorch官网推荐的安装方式是cuda11.1+pytorch1.8.0(找不到cuda11.1+pytorch1.6.0的安装版本)

结果pytorch1.8.0在我的代码里面依然报错,然后就装了pytorch1.8.1(torchvision0.9.1),然后就出现开头这个错误了

最终解决办法:继续降版本,安装pytorch1.7.1

pip install torch===1.7.1+cu110 torchvision===0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.htm

由于目前使用pytorch1.8.1的小伙伴还不多,因此为后人记录下,以防踩坑。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐