记录一下在Yolov5/Yolov5 lite上训练自己数据集报错总结记录

报错1、

UnicodeDecodeError: 'gbk' codec can't decode byte 0x8b in position 233: illegal multibyte sequence

报这个错误,通常是由于data.yaml配置文件没弄好,里面训练图片路径和验证集路径一定要对,直接重新复制一个,填入自己的文件路径就行,类别数要记得更改。

train: /root/YOLOv5-Lite/data/coco/images/train2017  # 118287 images
val: /root/YOLOv5-Lite/data/coco/images/val2017  # 5000 images
test: /root/YOLOv5-Lite/data/coco/images/test2017  # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794

# number of classes
nc: 80

# class names
names: [ 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
         'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
         'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
         'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard',
         'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
         'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
         'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone',
         'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear',
         'hair drier', 'toothbrush' ]

报错2、

RuntimeError: result type Float can‘t be cast to the desired output

进入utils/loss.py找到以下两处位置代码
在这里插入图片描述
在另一位置:

indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1)))  # image, anchor, grid 

改为:

indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1)))  # image, anchor, grid

以上改完即可解决。

合理的创建标题,有助于目录的生成

直接输入1次#,并按下space后,将生成1级标题。
输入2次#,并按下space后,将生成2级标题。
以此类推,我们支持6级标题。有助于使用TOC语法后生成一个完美的目录。

报错3、

出现以下错误

OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized

在train.py 脚本中加入以下代码

import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

报错4、

wandb 重连
进入/utils/loggers/wandb/wandb_utils.py
找到以下代码,yolov5 lite 在utils/wandb_logginf/wandb_utils.py

try:
    import wandb
    from wandb import init, finish
except ImportError:
    wandb = None

直接注释,然后加wandb = None

#try:
 #   import wandb
  #  from wandb import init, finish
#except ImportError:
 #   wandb = None
    
wandb = None

以上仅仅做记录

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值