开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 5634|回复: 18
收起左侧

[图文资料] 大漠插件yolov5相关问题汇总

[复制链接]
发表于 2024-3-1 17:29:21 | 显示全部楼层 |阅读模式   江苏省宿迁市
最近研究大漠yolov5,从配置环境到使用遇到一系列问题,这里把我遇到的问题和解决方法分享一下.

1.python安装问题
首先是安装py不要安装最新版本,最高支持3.11.8.

2.cmd无响应
全程科学上网,很多插件是需要科学上网才可以下载的,科学上网千万别关掉,包括最后跑图也不要关掉.

3.已经安装高版本python
卸载掉就行,但是注意更改环境变量

比如:
比如我这里是
   C:\Users\Administrator\AppData\Local\Programs\Python\Python312
   C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Scripts

改成
比如我这里是
   C:\Users\Administrator\AppData\Local\Programs\Python\Python311

   C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Scripts


4.安装yolo失败
多半是因为py版本问题,导致部分插件不支持,换低版本py

5.训练开头报错
我遇到可以训练,但是开头有错误,错误信息为:AttributeError: 'FreeTypeFont' object has noattribute 'getsize'
这里是因为Pillow版本太高,需要降级,用cmd输入:pip install Pillow==9.5 ,安装9.5版本即可.

6.在训练好之后,发现模型无法识别,
先降低权重(置信度)试一试是否模型训练有问题,在转换格式的时候一定要注意设置密码必须为英文.
未命名图片.png

发表于 2024-12-4 00:37:14 | 显示全部楼层   广东省汕头市
谢谢分享。
回复 支持 反对

使用道具 举报

签到天数: 1 天

发表于 2024-11-1 11:58:55 | 显示全部楼层   江苏省宿迁市
hy520101 发表于 2024-11-1 11:58
E:\dm_yolov5\yolo\yolov5-7.0>python export.py --weights yolov5s.pt --simplify --include onnx export: ...

这个咋解决?
回复 支持 反对

使用道具 举报

签到天数: 1 天

发表于 2024-11-1 11:58:41 | 显示全部楼层   江苏省宿迁市
E:\dm_yolov5\yolo\yolov5-7.0>python export.py --weights yolov5s.pt --simplify --include onnx export: data=E:\dm_yolov5\yolo\yolov5-7.0\data\coco128.yaml, weights=['yolov5s.pt'], imgsz=[640, 640], batch_size=1, device=cpu, half=False, inplace=False, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=12, verbose=False, workspace=4, nms=False, agnostic_nms=False, topk_per_class=100, topk_all=100, iou_thres=0.45, conf_thres=0.25, include=['onnx'] YOLOv5  2023-8-5 Python-3.11.5 torch-2.5.1+cu118 CPU  E:\dm_yolov5\yolo\yolov5-7.0\models\experimental.py:79: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.   ckpt = torch.load(attempt_download(w), map_location='cpu')  # load Fusing layers... YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients, 16.4 GFLOPs  PyTorch: starting from yolov5s.pt with output shape (1, 25200, 85) (14.1 MB) ONNX: export failure  1.1s: DLL load failed while importing onnx_cpp2py_export: (DLL) Traceback (most recent call last):   File "E:\dm_yolov5\yolo\yolov5-7.0\export.py", line 658, in <module>     main(opt)   File "E:\dm_yolov5\yolo\yolov5-7.0\export.py", line 652, in main     run(**vars(opt))   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context     return func(*args, **kwargs)            ^^^^^^^^^^^^^^^^^^^^^   File "E:\dm_yolov5\yolo\yolov5-7.0\export.py", line 569, in run     f[2], _ = export_onnx(model, im, file, opset, dynamic, simplify)               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "E:\dm_yolov5\yolo\yolov5-7.0\export.py", line 113, in outer_func     raise e   File "E:\dm_yolov5\yolo\yolov5-7.0\export.py", line 108, in outer_func     f, model = inner_func(*args, **kwargs)                ^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "E:\dm_yolov5\yolo\yolov5-7.0\export.py", line 139, in export_onnx     import onnx   File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\onnx\__init__.py", line 77, in <module>     from onnx.onnx_cpp2py_export import ONNX_ML ImportError: DLL load failed while importing onnx_cpp2py_export: 动态链接库(DLL)初始化例程失败。 请按任意键继续. . .
回复 支持 1 反对 0

使用道具 举报

结帖率:71% (17/24)
发表于 2024-10-26 22:33:09 | 显示全部楼层   湖南省永州市
我用anaconda装的python,大漠工具点训练直接黑一秒就没了,什么错误也不知道
回复 支持 反对

使用道具 举报

发表于 2024-9-28 12:10:14 | 显示全部楼层   上海市上海市
都装好了 训练是不识别显卡  就CPU在训练 慢死了..咋回事啊
回复 支持 反对

使用道具 举报

结帖率:100% (1/1)

签到天数: 15 天

发表于 2024-7-21 19:30:01 | 显示全部楼层   美国
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with ‘pybind11>=2.12’.

二、解决方法
pip install "numpy<2"
回复 支持 反对

使用道具 举报

结帖率:100% (1/1)

签到天数: 15 天

发表于 2024-7-21 19:26:46 | 显示全部楼层   美国
[Python] 纯文本查看 复制代码
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "C:\yolo\yolov5-7.0\detect.py", line 43, in <module>
    from models.common import DetectMultiBackend
  File "C:\yolo\yolov5-7.0\models\common.py", line 29, in <module>
    from utils.dataloaders import exif_transpose, letterbox
  File "C:\yolo\yolov5-7.0\utils\dataloaders.py", line 25, in <module>
    import torchvision
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchvision\__init__.py", line 6, in <module>
    from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchvision\models\__init__.py", line 2, in <module>
    from .convnext import *
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchvision\models\convnext.py", line 8, in <module>
    from ..ops.misc import Conv2dNormActivation, Permute
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchvision\ops\__init__.py", line 23, in <module>
    from .poolers import MultiScaleRoIAlign
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchvision\ops\poolers.py", line 10, in <module>
    from .roi_align import roi_align
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchvision\ops\roi_align.py", line 4, in <module>
    import torch._dynamo
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\__init__.py", line 64, in <module>
    torch.manual_seed = disable(torch.manual_seed)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\decorators.py", line 50, in disable
    return DisableContext()(fn)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\eval_frame.py", line 410, in __call__
    (filename is None or trace_rules.check(fn))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\trace_rules.py", line 3378, in check
    return check_verbose(obj, is_inlined_call).skipped
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\trace_rules.py", line 3361, in check_verbose
    rule = torch._dynamo.trace_rules.lookup_inner(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\trace_rules.py", line 3442, in lookup_inner
    rule = get_torch_obj_rule_map().get(obj, None)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\trace_rules.py", line 2782, in get_torch_obj_rule_map
    obj = load_object(k)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\trace_rules.py", line 2811, in load_object
    val = _load_obj_from_str(x[0])
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\_dynamo\trace_rules.py", line 2795, in _load_obj_from_str
    return getattr(importlib.import_module(module), obj_name)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nested\_internal\nested_tensor.py", line 417, in <module>
    values=torch.randn(3, 3, device="meta"),
C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nested\_internal\nested_tensor.py:417: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
  values=torch.randn(3, 3, device="meta"),
detect: weights=['yolov5s.pt'], source=data/images/bus.jpg, data=data\coco128.yaml, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs\detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5  2023-8-5 Python-3.11.8 torch-2.3.1+cpu CPU

Fusing layers...
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients, 16.4 GFLOPs
Traceback (most recent call last):
  File "C:\yolo\yolov5-7.0\detect.py", line 259, in <module>
    main(opt)
  File "C:\yolo\yolov5-7.0\detect.py", line 254, in main
    run(**vars(opt))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\yolo\yolov5-7.0\detect.py", line 117, in run
    im = torch.from_numpy(im).to(model.device)
         ^^^^^^^^^^^^^^^^^^^^
RuntimeError: Numpy is not available
回复 支持 反对

使用道具 举报

结帖率:93% (223/240)

签到天数: 14 天

发表于 2024-6-27 09:50:42 | 显示全部楼层   上海市上海市
请教一下;;  大漠yolo 能不能实时跟踪检测呢????  能否指点一下
回复 支持 反对

使用道具 举报

结帖率:100% (1/1)
发表于 2024-4-19 13:09:18 | 显示全部楼层   江苏省南京市
来学习一下这年头
回复 支持 反对

使用道具 举报

结帖率:98% (86/88)

签到天数: 9 天

发表于 2024-4-19 11:58:18 | 显示全部楼层   江西省宜春市
请问为什么大漠综合工具识别测试都是正常的,用易语言识别就没内容返回,加载模型什么都是成功的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表