报错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

以上仅仅做记录

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐