导入torch时,报错 Error loading “C:\Users\Thinkpad\AppData\Roaming\Python\Python311\site-packages\torch\li

1.报错内容:

 Error loading "C:\Users\Thinkpad\AppData\Roaming\Python\Python311\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

2.报错原因:是因为torch和python版本不对应

3.解决方案:

重新安装torch,输入命令:pip install torch==2.0.0,重新安装就可以了

4.以下是torch以及torchvision和python的版本对应图

导入torch时,报错 Error loading “C:\Users\Thinkpad\AppData\Roaming\Python\Python311\site-packages\torch\li_第1张图片

导入torch时,报错 Error loading “C:\Users\Thinkpad\AppData\Roaming\Python\Python311\site-packages\torch\li_第2张图片

你可能感兴趣的:(python,开发语言)