yolov5训练自己的数据集-错误记录


环境介绍: ubantu16.04,pytorch,yolov5-v4
用yolov5训练自己的数据集!


1.

问题描述:gnutls_handshake() failed: The TLS connection was non-properly terminated.
subprocess.CalledProcessError: Command 'if [ -d .git ]; then git fetch && gi
错误定位:

    if opt.global_rank in [-1, 0]:
        check_git_status()

欠妥的办法:查了一些资料,未能找到有效解决方案,索性先不做检查,即注释掉这行代码
欠妥办法可能带来的影响:目前还不清楚
可以参考的东西:Git gnutls_handshake() failed解决办法 - 青山牧云人 - 博客园

2.

问题描述:yaml.scanner.ScannerError: while scanning a simple key  in "data/coco.yaml", line 18, column 1 could not find expected ':'  in "data/coco.yaml", line 20, column 1
错位定位:

 data_dict = yaml.load(f, Loader=yaml.FullLoader) 

 错误原因:.yaml文件中的键和值没有用空格隔开,
 解决方式:键和值之间添加空格,我这里是 nc:1,修改完之后是 nc: 1

3.

问题描述:Images sizes do not match. This will causes images to be display incorrectly in the UI.

4.

问题描述:UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`.  Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. 

问题分析:UserWarning:检测到在'optimizer.step()'之前调用'lr_scheduler.step()'。在PyTorch 1.1.0及更高版本中,应该以相反的顺序调用它们:`optimizer.step()`在`lr_scheduler.step()之前。否则将导致PyTorch跳过学习率计划的第一个值。
解决方式:先调用optimizer.step() 再调用lr_scheduler.step()。

5.

问题描述:TypeError: int() can't convert non-string with explicit base
错误定位:

def color_list():
    # Return first 10 plt colors as (r,g,b) https://stackoverflow.com/questions/51350872/python-from-color-name-to-rgb
    def hex2rgb(h):
        return tuple(int(h[1 + i:1 + i + 2], 16) for i in (0, 2, 4))

    return [hex2rgb(h) for h in plt.rcParams['axes.prop_cycle'].by_key()['color']]

解决方式:把上述代码替换为

def color_list():
    # Return first 10 plt colors as (r,g,b) https://stackoverflow.com/questions/51350872/python-from-color-name-to-rgb
    def hex2rgb(h):
        return tuple(int(h[1 + i:1 + i + 2], 16) for i in (0, 2, 4))

    return [hex2rgb(h) for h in matplotlib.colors.TABLEAU_COLORS.values()]

可以参考的东西:TypeError: int() can't convert non-string with explicit base · Issue #2066 · ultralytics/yolov5 · GitHub

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 19
    评论
YOLO系列是基于深度学习的端到端实时目标检测方法。 PyTorch版的YOLOv5轻量而高性能,更加灵活和易用,当前非常流行。 本课程将手把手地教大家使用labelImg标注和使用YOLOv5训练自己的数据集。课程实战分为两个项目:单目标检测(足球目标检测)和多目标检测(足球和梅西同时检测)。  本课程的YOLOv5使用ultralytics/yolov5,在Windows和Ubuntu系统上分别做项目演示。包括:安装YOLOv5、标注自己的数据集、准备自己的数据集(自动划分训练集和验证集)、修改配置文件、使用wandb训练可视化工具、训练自己的数据集、测试训练出的网络模型和性能统计。 除本课程《YOLOv5实战训练自己的数据集(Windows和Ubuntu演示)》外,本人推出了有关YOLOv5目标检测的系列课程。请持续关注该系列的其它视频课程,包括:《YOLOv5(PyTorch)目标检测:原理与源码解析》课程链接:https://edu.csdn.net/course/detail/31428《YOLOv5目标检测实战:Flask Web部署》课程链接:https://edu.csdn.net/course/detail/31087《YOLOv5(PyTorch)目标检测实战:TensorRT加速部署》课程链接:https://edu.csdn.net/course/detail/32303《YOLOv5目标检测实战:Jetson Nano部署》课程链接:https://edu.csdn.net/course/detail/32451《YOLOv5+DeepSORT多目标跟踪与计数精讲》课程链接:https://edu.csdn.net/course/detail/32669《YOLOv5实战口罩佩戴检测》课程链接:https://edu.csdn.net/course/detail/32744《YOLOv5实战中国交通标志识别》课程链接:https://edu.csdn.net/course/detail/35209 《YOLOv5实战垃圾分类目标检测》课程链接:https://edu.csdn.net/course/detail/35284  
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值