FPN icon indicating copy to clipboard operation
FPN copied to clipboard

training on my own dataset

Open liuliu66 opened this issue 6 years ago • 14 comments

@unsky Hi, unsky. I really appreciate the code for FPN. But when I used it I got very bad mAP for my single object detection task on my own dataset. I have changed the parameters in train.prototxt and train_mergercnn.prototxt with changing 21 to 2 (object + background) and 84 to 8. The code could run well and loss also looks fine. So could you please tell me are there other places I need to change parameters to for training on my dataset?

qq 20180114130425

liuliu66 avatar Jan 14 '18 05:01 liuliu66

you have bug in test code, i think you havenot restore the rois. i do this in https://github.com/unsky/FPN/blob/2f3e5c39452ac89217a40ab1174b39fa424d71cf/lib/fast_rcnn/test.py#L292

rgb's faster rcnn do this in: https://github.com/rbgirshick/py-faster-rcnn/blob/4e199d792f625cf712ca9b9a16278bafe0806201/lib/fast_rcnn/train.py#L65

unsky avatar Jan 14 '18 05:01 unsky

@unsky Solved! Amazing result! Thanks for your help!

liuliu66 avatar Jan 14 '18 05:01 liuliu66

@liuliu66 Hello, I got a problem same as you. Can you show me the detail that you solved the problem? I still don't know how to fix it. Thanks!

TongYoungG avatar Jan 18 '18 02:01 TongYoungG

@gk616828144 Hello, my problem is duo to run a wrong sh file so I just check the test.sh and change the model path to my trained model path and the problem is solved. I think if you could run the code on your dataset and got seemly correct loss you could get correct caffemodel file. You can check test.sh and test_mergercnn.sh carefully to solve it.

liuliu66 avatar Jan 18 '18 06:01 liuliu66

I have changed the parameters in train.prototxt with changing 21 to 3 (object + background) and 84 to 12. cls_score_concat :Top shape:4 3(12)? error:Creating layer loss_cls F0118 13:55:03.960583 15560 loss_layer.cpp:19] Check failed: bottom[0]->num() == bottom[1]->num() (4 vs. 1) The data and label should have the same number.

lixiangamy avatar Jan 18 '18 07:01 lixiangamy

@lixiangamy use fpn-caffe!

unsky avatar Jan 18 '18 08:01 unsky

What are the differences between fpn-caffe and caffe-fast-rcnn?I used caffe-fast-rcnn

lixiangamy avatar Jan 18 '18 08:01 lixiangamy

Duplicate of #21 https://github.com/unsky/FPN/issues/21

unsky avatar Jan 18 '18 08:01 unsky

@unsky hello,how to restore the rois? I still don't what to do.When I test imgs,the rois is all the same. I don't know where the error is.

TongYoungG avatar Jan 19 '18 09:01 TongYoungG

@unsky 虽然@liuliu66的问题是由于file文件导致的,但您指出 "i think you havenot restore the rois."这该如何理解呢?

foralliance avatar Jun 02 '18 10:06 foralliance

FPN属于faster rcnn框架发展而来,保留了faster rcnn对于rois的设置,faster rcnn 有一个trick就是对第二阶段的rcnn的rois做了白化处理,这种策略可以加速收敛,当然也需要我们在测试阶段进行一次反白化。

unsky avatar Jul 03 '18 15:07 unsky

@unsky HI 在FPN的test.py中,在im_detect函数中,对最终的结果确实多了一个normalize操作,这个操作在py-faster-rcnn中是没有的. 在py-faster-rcnn中的trian.py中,也多了一个normalize操作,这个操作在FPN中是没有的.

这2者之间有关系吗?一个是训练的,一个是测试的.而且,您所谓的反白话又是什么意思??

foralliance avatar Jul 09 '18 14:07 foralliance

作者您好, 请问训练集像素大小为100100, 目标大小为4040 ,请问 训练时如何设置anchor大小?? 谢谢作者啦

mantou22 avatar Oct 16 '18 06:10 mantou22

您好,请问为什么我训练自己的模型会怎么慢速度? 前面几百次迭代,每20次只需要 34S 左右, 到了2000次左右时, 每20次需要 5-6分钟 为什么会那么慢????? 我的显卡是 GPU 1080Ti 的 12G运行内存

mantou22 avatar Oct 23 '18 07:10 mantou22