unsky / FPN

Feature Pyramid Networks for Object Detection
524 stars 263 forks source link

training on my own dataset #28

Open liuliu66 opened 6 years ago

liuliu66 commented 6 years ago

@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

unsky commented 6 years ago

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

liuliu66 commented 6 years ago

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

TongYoungG commented 6 years ago

@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!

liuliu66 commented 6 years ago

@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.

lixiangamy commented 6 years ago

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.

unsky commented 6 years ago

@lixiangamy use fpn-caffe!

lixiangamy commented 6 years ago

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

unsky commented 6 years ago

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

TongYoungG commented 6 years ago

@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.

foralliance commented 6 years ago

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

unsky commented 6 years ago

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

foralliance commented 6 years ago

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

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

mantou22 commented 6 years ago

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

mantou22 commented 6 years ago

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