window系统运行pytorch找不到指定的模块,报错“fbgemm.dll“ or one of its dependencies.”

安装好pytorch后,import torch报错如下:

Traceback (most recent call last):
  File "d:\work_space\01_code\BMCourse\exercises\L2_NLP_pipeline_pytorch\annotated_code\test.py", line 1, in <module>
    import torch
  File "C:\Users\ZJ\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\__init__.py", line 148, in <module>
    raise err
OSError: [WinError 126] 找不到指定的模块。 Error loading "C:\Users\ZJ\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

这里提示加载不到fbgemm.dl或者缺少依赖项,但在xxx\Python\Python312\Lib\site-packages\torch\lib\ 路径下存在fbgemm.dll文件,那应该是缺少了依赖项

解决办法:

 1、下载Dependencies,用于window系统查看文件的依赖项,压缩文件包,运行DependenciesGui.exe,导入xxx\Python\Python312\Lib\site-packages\torch\lib\fbgemm.dll文件,可以看到红点确实的文件

2、我这里缺少的文件libomp140.x86_64.dll,把文件放到fbgemm.dll的同目录下即可

附件:所需文件包也可在csdn下载

https://download.csdn.net/download/weixin_44598491/89634591

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值