YOLOv3-complete-pruning icon indicating copy to clipboard operation
YOLOv3-complete-pruning copied to clipboard

算法训练自己的数据集mAP无法提高

Open lilong-epfl opened this issue 6 years ago • 21 comments

您好,我用规整剪枝的稀疏化训练自己的数据集,训练的mAP一直无法升高,算法识别率低,请问是什么原因。我的数据比hand数据集大写,有接近2万张照片,用YOLOv3源码训练没有问题。

Screen Shot 2019-11-09 at 11 23 05 AM

lilong-epfl avatar Nov 09 '19 03:11 lilong-epfl

Just because hands database is very small,only have one classes. So it can be reduce branch,multi class cant perform well.

zjutlzt avatar Nov 11 '19 01:11 zjutlzt

I trained the same dataset using YOLOv3-model-pruning, it worked well, but somehow it still doesn't work with this algorithm.

lilong-epfl avatar Nov 11 '19 09:11 lilong-epfl

同样的问题,自己的数据集11类,训练集共10万个样本,训练了80个epoch,验证集mAP无法提高、loss升高,只有训练集loss持续下降。同样数据集在yolov3原项目以及其他剪枝项目中没问题

courtfu avatar Nov 14 '19 02:11 courtfu

@courtfu 您好,请问您说的同样的数据集在yolov3原项目中没问题,这个yolov3原项目是哪个yolov3版本?是ultralytics的吗?

coldlarry avatar Nov 14 '19 02:11 coldlarry

Hello, do you use voc or coco dataset?

Damon2019 avatar Nov 26 '19 11:11 Damon2019

@Damon2019 no, I am using my own data.

lilong-epfl avatar Nov 27 '19 01:11 lilong-epfl

@lilong-epfl Hello, can you tell me the detailed steps of making a dataset suitable for the training of this model with your own data set? May I add your contact information? Thank you!

Damon2019 avatar Nov 27 '19 11:11 Damon2019

I trained the same dataset using YOLOv3-model-pruning, it worked well, but somehow it still doesn't work with this algorithm.

Sorry to bother you, did you solved this problem.

Gaondong avatar Dec 03 '19 13:12 Gaondong

@Gaondong no, I didn't solve it.

lilong-epfl avatar Dec 04 '19 06:12 lilong-epfl

@Gaondong no, I didn't solve it.

@lilong-epfl Thanks for your reply, I will try YOLOv3-model-pruning project later.

Gaondong avatar Dec 04 '19 07:12 Gaondong

I train my own dataset use yolov3 and coco pre_model ,but the mAP is always 0.i want to know how to train my own datasets,where needs to be changed. Look forward to your reply!!!

pengyuan101 avatar Dec 06 '19 09:12 pengyuan101

@coldlarry I train my own dataset use yolov3 and coco pre_model ,but the mAP is always 0.i want to know how to train my own datasets,where needs to be changed. Look forward to your reply!!!

pengyuan101 avatar Dec 06 '19 09:12 pengyuan101

找到‘训练自己数据集map无法提高的原因了’,我提交的程序有个小问题,就是baseline训练(无稀疏化)时,默认打开了稀疏化,这可能是导致map无法提高的原因。解决办法是:在train文件的parser.add_argument中,将prune参数的默认值改为-1,当前的默认值为0(为0则打开了稀疏化)

coldlarry avatar Dec 10 '19 03:12 coldlarry

训练自己的数据集,no labels found. Recommend correcting image and label paths。 这是个什么问题啊?

lehuiwu avatar Dec 18 '19 06:12 lehuiwu

训练自己的数据集,no labels found. Recommend correcting image and label paths。 这是个什么问题啊?

路径问题吧 就是没找到label路径啊 按照要求制作数据集 https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data

Gaondong avatar Dec 18 '19 07:12 Gaondong

找到‘训练自己数据集map无法提高的原因了’,我提交的程序有个小问题,就是baseline训练(无稀疏化)时,默认打开了稀疏化,这可能是导致map无法提高的原因。解决办法是:在train文件的parser.add_argument中,将prune参数的默认值改为-1,当前的默认值为0(为0则打开了稀疏化)

改为-1之后,代码就跑不了了

pengyuan1 avatar Dec 18 '19 08:12 pengyuan1

现在可以跑了,不过,请问一下只能用cpu稀疏化训练,不能用gpu训练么?谢谢🙏 ------------------ 原始邮件 ------------------ 发件人: "Gaondong"[email protected] 发送时间: 2019年12月18日(星期三) 下午3:01 收件人: "coldlarry/YOLOv3-complete-pruning"[email protected]; 抄送: "lehuiwu"[email protected];"Comment"[email protected]; 主题: Re: [coldlarry/YOLOv3-complete-pruning] 算法训练自己的数据集mAP无法提高 (#13)

训练自己的数据集,no labels found. Recommend correcting image and label paths。 这是个什么问题啊?

路径问题吧 就是没找到label路径啊 按照要求制作数据集 https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

lehuiwu avatar Dec 18 '19 09:12 lehuiwu

我用的时候是可以gpu训练的  我没有遇到这个问题  看看是不是你的环境配置问题吧  torch是否支持cuda加速

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: lehuiwu <[email protected]> 发送时间: 2019年12月18日 17:00 收件人: coldlarry/YOLOv3-complete-pruning <[email protected]> 抄送: Gaondong <[email protected]>, Mention <[email protected]> 主题: 回复:[coldlarry/YOLOv3-complete-pruning] 算法训练自己的数据集mAP无法提高 (#13)

现在可以跑了,不过,请问一下只能用cpu稀疏化训练,不能用gpu训练么?谢谢🙏 ------------------ 原始邮件 ------------------ 发件人: "Gaondong"<[email protected]> 发送时间: 2019年12月18日(星期三) 下午3:01 收件人: "coldlarry/YOLOv3-complete-pruning"<[email protected]>; 抄送: "lehuiwu"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [coldlarry/YOLOv3-complete-pruning] 算法训练自己的数据集mAP无法提高 (#13)

训练自己的数据集,no labels found. Recommend correcting image and label paths。 这是个什么问题啊?

路径问题吧 就是没找到label路径啊 按照要求制作数据集 https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data

&mdash; You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Gaondong avatar Dec 18 '19 09:12 Gaondong

找到‘训练自己数据集map无法提高的原因了’,我提交的程序有个小问题,就是baseline训练(无稀疏化)时,默认打开了稀疏化,这可能是导致map无法提高的原因。解决办法是:在train文件的parser.add_argument中,将prune参数的默认值改为-1,当前的默认值为0(为0则打开了稀疏化)

改为-1之后,代码就跑不了了

        if hasattr(model, 'module'):             
            if opt.prune!=-1:BNOptimizer.updateBN(sr_flag, model.module.module_list, opt.s, prune_idx)
        else:
            if opt.prune!=-1:BNOptimizer.updateBN(sr_flag, model.module_list, opt.s, prune_idx)

不仅要改-1,这里也要改,改完可以跑

zhaodongxi avatar Dec 18 '19 10:12 zhaodongxi

找到‘训练自己数据集map无法提高的原因了’,我提交的程序有个小问题,就是baseline训练(无稀疏化)时,默认打开了稀疏化,这可能是导致map无法提高的原因。解决办法是:在train文件的parser.add_argument中,将prune参数的默认值改为-1,当前的默认值为0(为0则打开了稀疏化)

这个应该不成立吧,稀疏化有一个sr_flag,只有使用-sr的时候才打开吧,否则sr_flag=false,BNOptimizer不会打开稀疏化

li-peize avatar Dec 21 '19 08:12 li-peize

找到‘训练自己数据集map无法提高的原因了’,我提交的程序有个小问题,就是baseline训练(无稀疏化)时,默认打开了稀疏化,这可能是导致map无法提高的原因。解决办法是:在train文件的parser.add_argument中,将prune参数的默认值改为-1,当前的默认值为0(为0则打开了稀疏化) ,请问模型剪纸第一步是正常化训练还是 直接稀疏化训练,不太理解?

nanhui69 avatar Feb 19 '22 05:02 nanhui69