在yolov5-6 中 单独创建文件计算anchor 时报错

import utils.autoanchor as autoAC# 对数据集重新计算 anchors
new_anchors = autoAC.kmean_anchors('data/test.yaml', 3, 320, 4.0, 1000, True)
print(new_anchors)

报错:

File "D:\Anaconda3\envs\yolo\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_mainraise RuntimeError('''
RuntimeError: An attempt has been made to start a new process before thecurrent process has finished its bootstrapping phase.This probably means that you are not using fork to start yourchild processes and you have forgotten to use the proper idiomin the main module:if __name__ == '__main__':freeze_support()...The "freeze_support()" line can be omitted if the programis not going to be frozen to produce an executable.

原因是没有吧要运行的函数放到main 函数中执行

把你要运行的代码块放到main函数中运行 ok

import utils.autoanchor as autoAC
if __name__ == '__main__':# 对数据集重新计算 anchorsnew_anchors = autoAC.kmean_anchors('data/test.yaml', 3, 320, 4.0, 1000, True)print(new_anchors)

yolov5-6 The “freeze_support()“ line can be omitted if the program is not going to be frozen相关推荐

  1. Pytorch报错:“freeze_support()“ line can be omitted if the program is not going to be frozen(已解决)

    报错提示: 运行 pytoch 测试代码时,出现如下报错: model [TestModel] was created liu yaxin 21 Traceback (most recent call ...

  2. PyTorch:The “freeze_support()” line can be omitted if the program is not going to be frozen

    在windows上运行pytorch时,稍不注意就会遇到freeze_support()的错误.解决这种错误只要把代码放到if name == "main": 中运行就可以了.就忍 ...

  3. python 多进程 multiprocessing.Queue()报错:The freeze_support() line can be omitted if the program

    运行以下多进程测试代码时报错: # -*- coding: utf-8 -*- """ @File : test_191205_测试多进程Multiprocessing_ ...

  4. python进程池multiprocessing.Pool运行错误:The freeze_support() line can be omitted if the program is not g

    测试代码如下: 原文:https://blog.csdn.net/xiemanr/article/details/71700531 # -*- coding: utf-8 -*- import mul ...

  5. torch The “freeze_support()” line can be omitted if the programis not going to be frozen to produce

    1.The "freeze_support()" line can be omitted if the programis not going to be frozen to pr ...

  6. python多进程原理_python多进程的详细介绍(附示例)

    本篇文章给大家带来的内容是关于PHP中的SAPI是什么?如何实现?(图文),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 进程 Python是运行在解释器中的语言,查找资料知道,py ...

  7. RuntimeError: An attempt has been made to start a new process before the current pr

    pytorch 加载数据时报错: RuntimeError:          An attempt has been made to start a new process before the   ...

  8. Python中的并行处理(Pool.map()、Pool.starmap()、Pool.apply()、)

    1.并行处理 并行处理是一种在同一台计算机的多个处理器中同时运行任务的工作模式.这种工作模式的目的就是减少总的任务处理时间,但是进程之间的通信会有额外的开销,因此对小的任务而言,总的任务时间会有所增加 ...

  9. PyTorch官方教程中文版:PYTORCH之60MIN入门教程代码学习

    Pytorch入门 import torch""" 构建非初始化的矩阵 """x = torch.empty(5,3) #print(x)& ...

最新文章

  1. Struts2 格式化输出时间
  2. c语言贪心算法合并箭,LeetCode刷题题库:贪心算法
  3. leetcode-1-两数之和
  4. 陌生的是人心,是人性,是社会,是世道
  5. 周选特辑|一些超棒的开源项目!
  6. 【Elasticsearch】Bkd-Tree 在 Lucene 中的实现
  7. C++ RGB转灰度图像
  8. 10个python办公黑科技,助你办公效率提高100倍
  9. 转载-从信息论角度论证为什么汉语是世界上最先进的语言--引用多项实验数据...
  10. SpringBoot系统监控,oshi版
  11. 知识产权服务机构列表
  12. CSS -- CSS字体样式、文本样式、去掉列表的小圆点、背景、背景渐变
  13. 这样投简历,99%没面试机会!
  14. 解密Google Deepmind AlphaGo围棋算法:真人工智能来自于哪里?
  15. linux查看GPU使用情况 linux如何查看GPU使用情况
  16. 软件英文术语缩写大全
  17. 第二届计算机辅助教育国际大会,【回看】2019年第二届翻译教育国际研讨会 机助译员训练 (CATT): 人机之间...
  18. 亚特兰蒂斯【线段树+扫描线+离散化】
  19. DP4301频段在470mhz~510mhz的SUB-1G集成芯片超低功耗
  20. 基于涂鸦模组和ITOP4412开发板的宠物喂食器

热门文章

  1. 各大电商平台API接口合集-苏宁易购获得suning商品详情 API 返回值说明
  2. 4组64节蓄电池内阻/温度/电压一体监测方案
  3. 计算机视觉与图像识别综述
  4. 关于图片下载报链接不安全的问题,SSL证书信任相关
  5. Ubuntu如何修改键盘和语言
  6. MySQL死锁详解及检测和避免
  7. 5G科普——5G接入网
  8. [黑科技] 发现了一个Amazon黑科技插件,可以查看亚马逊卖家邮箱和电话。
  9. MIUI国际/欧版使用小米应用商店/国内浏览器-解决不会下载软件/上网问题
  10. C++原生游戏引擎开发棒子打老鼠游戏!