import torch报错解决

  • 问题描述

运行import torch语句报错:...symbol cudaGraphRetainUserObject, version libcudart.so.11.0 not defined...

import torch报错解决_第1张图片
  • 分析

此时运行环境为python3.8、cuda11.1、torch1.12

出现上述错误应该是因为torch和cuda版本不匹配

  • 解决方法

重新安装对应版本的torch即可

pip3 install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio===0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
import torch报错解决_第2张图片

你可能感兴趣的:(python,pytorch)