-
Notifications
You must be signed in to change notification settings - Fork 420
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
Using Resnet50 for FRCN #7
Comments
@miraclebiu Thank you for this work. To better use ResNet, I think you should keep the bn layer fixed, skipping re-computing mean and var during training. |
looking forward for your latest result. |
I read your code agian and find you've disabled the updating of bn, by passing
There is a resnet implement, https://github.com/ry/tensorflow-resnet, and also the pretrained models. |
I will try and if I can find the error, I will tell you |
This evening, I turn my code from the Faster-rcnn_TF to your project ,and I train the resnet50 for about 130k iterations ,the test performance map is about 70%,maybe is the Faster-rcnn_TF errors that I didn't find .In my previous opinion, since this project can train the VGG well ,so it can train resnet50 well too But I think I'm wrong. Besides , I also get the code about the psroipooling in R-FCN and implement in the tensorflow ,maybe I can send to you . |
I'm new about tensorflow and the FRCN, so I think I should read your code carefully and learn how to use it . |
@miraclebiu Congratulations! Very glad you made it. You can try pull request to send you awesome code to this repo. check this link https://help.github.com/articles/about-pull-requests/ And there are something very confusing in the original code, like the inconsistency of axis. some where the rpn_score is ordered by (1, H, W, A, 2) and some where (1, H, W, 2, A). |
@CharlesShang I write an email to your gmail. |
I run this on 0.11 ,you can check what's changed on 0.12 https://github.com/tensorflow/tensorflow/releases |
@miraclebiu I merge your contributions to |
@miraclebiu |
@CharlesShang I have tested the forward, I haven't test the backward, I find it on the github and have contrasted it with the caffe code and made some modifications,I think it is right. |
@CharlesShang ,maybe you can use tf.nn.top_k or tf.nn.in_top_k to sort the loss and use the tf.gather . |
@miraclebiu, online hard example mining (OHEM), data augment, etc., are very important for detection. I'll add these functions in a few days. A sinple way is to check out the R-FCN code and find out how they use OHEM:-). |
@CharlesShang the current map of Resnet101 model is 70.4% , it has iterated 150k , maybe it need more iterations . The converted Resnet50 and Resnet 101 model has a small gap about 0.6% top5 error, so there is no big difference between using Resnet50 and Resnet101 ,but the Resnet101 model is about twice bigger than the Resnet50. |
I think it's the best mAP we can get. |
Today I tried Resnet101 in CharlesShang/TFFRCNN (pulled latest codes as of
today from master branch), saw following error in training:
--------
Traceback (most recent call last):
File "./faster_rcnn/train_net.py", line 109, in <module>
restore=bool(int(args.restore)))
File "./faster_rcnn/../lib/fast_rcnn/train.py", line 396, in train_net
sw.train_model(sess, max_iters, restore=restore)
File "./faster_rcnn/../lib/fast_rcnn/train.py", line 108, in train_model
self.net.build_loss(ohem=cfg.TRAIN.OHEM)
File "./faster_rcnn/../lib/networks/network.py", line 446, in build_loss
cls_score = self.get_output('cls_score') # (R, C+1)
File "./faster_rcnn/../lib/networks/network.py", line 80, in get_output
raise KeyError('Unknown layer name fed: %s'%layer)
KeyError: 'Unknown layer name fed: cls_score'
…-----
This happens right after "Solving ...." and print of network layer names.
Went back to Minyue's fork, it works fine there.
Another question, I saw you are working on OHEM. Is it working in master
branch? Debug branch has more changes of OHEM.
Thanks
Dennis
On Mon, Dec 5, 2016 at 11:41 PM, Charles Shang ***@***.***> wrote:
I think it's the best mAP we can get.
Maybe the bottleneck is training data, the origianl paper (FasterRCNN +
ResNet101) reported the mAP on 07 was 0.738 using 07+12 for training.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAM4K9spoXwBjlan54alpQbHq_NW3tbIks5rFRG2gaJpZM4LBAdL>
.
|
Sorry to bother you again, I have tried to repalce the VGG to Resnet50 ,so I add two layers: add_layer and batch_normalization layer:
the model file is convert from the caffe-tensorflow project on the github(you can search this on the github), and I convert the bn_layer's data in the caffe to the moving_average and so on , but the result is really really bad ,map is about 55% , and I don't the reason ,maybe the model is not convert right?
Have you tried to replace VGG to resnet50
below is the resnet50_train.py:
class Resnet50_train(Network):
def init(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3], name='data')
self.im_info = tf.placeholder(tf.float32, shape=[None, 3], name='im_info')
self.gt_boxes = tf.placeholder(tf.float32, shape=[None, 5], name='gt_boxes')
self.gt_ishard = tf.placeholder(tf.int32, shape=[None], name='gt_ishard')
self.dontcare_areas = tf.placeholder(tf.float32, shape=[None, 4], name='dontcare_areas')
self.keep_prob = tf.placeholder(tf.float32)
self.layers = dict({'data':self.data, 'im_info':self.im_info, 'gt_boxes':self.gt_boxes,
'gt_ishard': self.gt_ishard, 'dontcare_areas': self.dontcare_areas})
self.trainable = trainable
self.setup()
The text was updated successfully, but these errors were encountered: