yolov3代码在win10下运行

小白记录贴

最近在研究YOLOv3,遇到了各种问题。。。

从GitHub上下载了用PyTorch实现的yolov3代码,代码链接为:https://github.com/eriklindernoren/PyTorch-YOLOv3

由于各种原因,本人只能在Windows系统下运行代码。

好不容易折腾好环境等配置了,可代码就是无法运行。主要报错如下:

This probably means that you are on Windows 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 a Windows executable.

在网上查了下,貌似是因为原代码应该在Linux下运行,在Windows系统中会因为什么分布式之类的原因出错。还没有来得及研究,先简单记录一下。可以参考以下几个博客:

https://blog.csdn.net/Solo95/article/details/78913709

http://www.cnblogs.com/wFrancow/p/8511711.html

https://blog.csdn.net/jacke121/article/details/79826420

总之,我在detect.py文件中加了下面这行命令,然后将后面的代码缩进,程序就能正常运行了。

if __name__ == '__main__':

运行效果如下:

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值