AlibabaResearch / efficientteacher

A Supervised and Semi-Supervised Object Detection Library for YOLO Series
GNU General Public License v3.0
799 stars 147 forks source link

用标准yolov5s转换为et模型后进行半监督训练,在训练过程中所有指标变为0 #64

Open wangyang581 opened 1 year ago

wangyang581 commented 1 year ago

我先自己训练了一个标准的yolov5s模型,然后用convert_yolov5_to_efficient.py脚本转换为efficient-yolov5s.pt,再进行半监督训练,配置文件如下:

project: './runs/yolov5_ssod' adam: False epochs: 200 weights: './data/et/fire_smoke/efficient-yolov5s.pt' prune_finetune: False linear_lr: True hyp: lr0: 0.001 hsv_h: 0.015 hsv_s: 0.7 hsv_v: 0.4 lrf: 1.0 scale: 0.9 burn_epochs: 20 no_aug_epochs: 0 warmup_epochs: 3

Model: depth_multiple: 0.33 # model depth multiple width_multiple: 0.50 # layer channel multiple Backbone: name: 'YoloV5' activation: 'SiLU' Neck: name: 'YoloV5' in_channels: [256, 512, 1024] out_channels: [256, 512, 1024] activation: 'SiLU' Head: name: 'YoloV5' activation: 'SiLU' anchors: [[10,13, 16,30, 33,23],[30,61, 62,45, 59,119],[116,90, 156,198, 373,326]] # P5/32] Loss: type: 'ComputeLoss' cls: 0.3 obj: 0.7 anchor_t: 4.0

Dataset: data_name: 'coco' train: ../od_data/fire_smoke_filter/train.txt # 118287 images val: ../od_data/fire_smoke_filter/test.txt # 5000 images test: ../od_data/fire_smoke_filter/test.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794^ target: ../od_data/fire_smoke_filter/unlabel.txt nc: 2 # number of classes np: 0 #number of keypoints names: ['fire', 'smoke'] img_size: 640 batch_size: 8

SSOD: train_domain: True nms_conf_thres: 0.1 nms_iou_thres: 0.65 teacher_loss_weight: 3.0 cls_loss_weight: 0.3 box_loss_weight: 0.05 obj_loss_weight: 0.7 loss_type: 'ComputeStudentMatchLoss' ignore_thres_low: 0.1 ignore_thres_high: 0.6 uncertain_aug: True use_ota: False multi_label: False ignore_obj: False pseudo_label_with_obj: True pseudo_label_with_bbox: True pseudo_label_with_cls: False with_da_loss: False da_loss_weights: 0.01 epoch_adaptor: True resample_high_percent: 0.25 resample_low_percent: 0.99 ema_rate: 0.999 cosine_ema: True imitate_teacher: False ssod_hyp: with_gt: False mosaic: 1.0 cutout: 0.5 autoaugment: 0.5 scale: 0.8 degrees: 0.0 shear: 0.0

开始半监督训练后,经过几个epoch所有指标变为0,请问是什么问题呢?

2023-04-11_16-07

DingNing-maker commented 1 year ago

我也遇到了同样的问题,请问怎么解决呢?

FangShao123 commented 1 year ago

我也是这个问题,我是改的yolov7x模型,然后自己写的map.txt。把之前训练好的拿来训练,训练到后面就全0了。而且,转换完之后验证和以前指标是否一致的时候也是全0。

BowieHsu commented 1 year ago

@wangyang581 您好,看起来是由于设置的半监督阈值问题导致伪标签太多,把student模型直接拉飞了,可以尝试将ignore_thres_high: 0.6 提高一些

2464774351 commented 10 months ago

您好,为什么跑出来的结果中验证集的损失函数都是为零呢 @BowieHsu

delicate00 commented 9 months ago

我也是这个问题,我是改的yolov7x模型,然后自己写的map.txt。把之前训练好的拿来训练,训练到后面就全0了。而且,转换完之后验证和以前指标是否一致的时候也是全0。

你好,我在转化好v7模型以后,配置文件的类别也是一一对应了的,但转换好权重后进行验证,其指标都为0,并且只有一行的数据,我的类别是有5个的。请问你最后解决了吗? 88e2dec7ada6ea8f0572781fea3d0ea

lwj1234 commented 8 months ago

请问你怎么把自己训练的yolo模型转成et的 @wangyang581

17781400225 commented 6 months ago

@wangyang581 您好,看起来是由于设置的半监督阈值问题导致伪标签太多,把student模型直接拉飞了,可以尝试将ignore_thres_high: 0.6 提高一些

您好我设置到0.9也没有用呢

17781400225 commented 6 months ago

我也是这个问题,我是改的yolov7x模型,然后自己写的map.txt。把之前训练好的拿来训练,训练到后面就全0了。而且,转换完之后验证和以前指标是否一致的时候也是全0。

你好,我在转化好v7模型以后,配置文件的类别也是一一对应了的,但转换好权重后进行验证,其指标都为0,并且只有一行的数据,我的类别是有5个的。请问你最后解决了吗? 88e2dec7ada6ea8f0572781fea3d0ea

请问解决了吗