python scatter_max算子不适配报错,RuntimeError: Not compiled with CUDA support

项目场景:

运行python做神经网络训练时,scatter_max算子不适配报错:RuntimeError: Not compiled with CUDA support


问题描述

RuntimeError: Not compiled with CUDA support


原因分析:

torch_scatter包版本和CUDA版本不匹配


解决方案:

  1. 删除当前版本torch_scatter
pip uninstall torch-scatter
  1. 安装匹配版本torch_scatter
pip install torch-scatter -f https://data.pyg.org/whl/torch-2.0.1+cu118.html

其中2.0.1代表当前pytorch版本号是2.0.1,当前CUDA版本号是11.8。这两个版本号需与自己电脑安装的相应的版本号匹配。

猜你喜欢

转载自blog.csdn.net/zmhzmhzm/article/details/131509916
今日推荐