Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mAP Question about Custom Dataset #341

Closed
Hone-Xu opened this issue May 25, 2022 · 11 comments
Closed

mAP Question about Custom Dataset #341

Hone-Xu opened this issue May 25, 2022 · 11 comments

Comments

@Hone-Xu
Copy link

Hone-Xu commented May 25, 2022

想请教下,我的为什么训练出来是这样的
results.png
image
train_batch0.jpg
image
train_batch1.jpg
image
train_batch2.jpg
image
train_batch3.jpg
image
val_batch0_labels.jpg
image
val_batch1_labels.jpg
image
@hukaixuan19970627 @sunbuhui @Ethan-niu

@Hone-Xu
Copy link
Author

Hone-Xu commented May 25, 2022

hyp.yaml

lr0: 0.01
lrf: 0.2
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.1
cls: 0.5
cls_pw: 1.0
theta: 0.5
theta_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.5
fliplr: 0.5
mosaic: 0.1
mixup: 0.0
copy_paste: 0.0
cls_theta: 180
csl_radius: 2.0

@Hone-Xu
Copy link
Author

Hone-Xu commented May 25, 2022

opt.yaml

weights: weights\yolov5m.pt
cfg: ''
data: data\yolov5obb_demo.yaml
hyp: data\hyps\obb\hyp.finetune_dota.yaml
epochs: 500
batch_size: 1
imgsz: 640
rect: false
resume: false
nosave: false
noval: false
noautoanchor: false
evolve: null
bucket: ''
cache: null
image_weights: false
device: '0'
multi_scale: false
single_cls: false
adam: false
sync_bn: false
workers: 0
project: runs\train
name: exp
exist_ok: false
quad: false
linear_lr: false
label_smoothing: 0.0
patience: 100
freeze:

  • 0
    save_period: -1
    local_rank: -1
    entity: null
    upload_dataset: false
    bbox_interval: -1
    artifact_alias: latest
    save_dir: runs\train\exp2

@Hone-Xu Hone-Xu changed the title 使用最新代码进行训练,mAp异常 自定义数据集训练效果mAP问题 May 25, 2022
@Hone-Xu
Copy link
Author

Hone-Xu commented May 25, 2022

image

@hukaixuan19970627
Copy link
Owner

  1. patience参数表示yolov5_obb经历patience个epoch的训练之后,若验证集的最高精度未发生改变,则中止训练。既然模型还未收敛,那你就往大了调呗
  2. 在你的应用场景中,建议数据增强策略关闭mixup,别的参数可以保持项目的默认设置不变
  3. 尽量调大batchsize,不然BN层的均值和方差参数可能计算的不准

@hukaixuan19970627 hukaixuan19970627 changed the title 自定义数据集训练效果mAP问题 mAP Question about Custom Dataset May 25, 2022
@Hone-Xu
Copy link
Author

Hone-Xu commented May 27, 2022

请问修改后我的mAP还是不上升这个是为什么
image
train_batch0.jpg
image
@hukaixuan19970627

@Hone-Xu
Copy link
Author

Hone-Xu commented May 27, 2022

我的两个类标注数量差距有点大,和这个有关系吗

@hukaixuan19970627
Copy link
Owner

hukaixuan19970627 commented May 30, 2022

初步分析可能是学习率的问题,看精度曲线、Loss曲线的话可以发现warmup阶段收敛还是挺正常的(这段时期lr0是慢慢地增长的),但是之后Box Loss就下不去了。建议lr0改成0.005~0.01试试看效果会不会好一点,权重文件记得用我提供的DOTAv1.5的预训练权重

@hukaixuan19970627
Copy link
Owner

数据集规模很小的话可以参考这个issue,他碰到的问题和你类似。

@FlinkRay
Copy link

FlinkRay commented Jun 23, 2022

数据集规模很小的话可以参考这个issue,他碰到的问题和你类似。

作者,您好,我想问一下在训练的时候map、precision、recall一直为0的错误原因是什么
image
results

loss是有的

@hukaixuan19970627
Copy link
Owner

@FlinkRay 新开一个issue

@FlinkRay
Copy link

@FlinkRay 新开一个issue

已经新开了,麻烦您帮忙看看

@hukaixuan19970627 hukaixuan19970627 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants