Windows下 import torchvision :ImportError: DLL load failed: The specified module could not be found.

35 篇文章 4 订阅
14 篇文章 0 订阅

1、在 Windows 下安装 pytorch 后 ,再安装 torchvision,

 

import torchvision : DLL load failed: The specified module could not be found.

 

解决方案:

缺少了必要的一些动态链接库,或者没英伟达显卡而误装了GPU版本的

在cmd中输入:conda install -c peterjc123 vc vs2017_runtime

再倒入 torchvision 就没问题了

 

2、运行错误

#使用pytorch时出现的多进程错误,如下描述:
RuntimeError:
    An attempt has been made to start a new process before the
    current process has finished its bootstrapping phase.

   This probably means that you are not using fork to start your
   child processes and you have forgotten to use the proper idiom
   in the main module:

       if __name__ == '__main__':
           freeze_support()
           ...

   The "freeze_support()" line can be omitted if the program
   is not going to be frozen to produce an executable.

解决方案:

#解决方案如下:
import torch
def main()
    for i, data in enumerate(dataloader):
        # do something here
if __name__ == '__main__':
    main()

 

Reference:

Win10环境下安装Pytorch(两个错误解决方法汇总)

知乎-PyTorch 0.4.0 正式版 - Windows 说明

pytorch0.4.0官方文档

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值