-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Train Faster R-CNN with different backbone #184
Comments
+1 |
+2 |
I now implemented the conv body for the network in python and used the converted .pkl file as pretrained weights. To convert the .caffemodel weights to the pickle file, I only kept the conv body part of the network in the deploy.prototxt file. Here is my python implementation, in case anyone is interested. It is a smaller version of the GoogLeNet, called GoogLeNet-xxs, described here. The original network has more inception parts:
I am still curious if there is a way to load a network without implementing the network structure in python. Since issue #339 targets this question a little more in detail, I will close this issue here. |
where can we get the weights? |
Short answer: You can download my generated pretrained weights for the GoogLeNet-xxs here Longer answer, how I generated the file: In general, what I did is download the .caffemodel and deploy.prototxt from the caffe model zoo here. Then I deleted everything from the deploy.txt except the convolution part I want to train with. Next I fed it to the detectron/tools/pickle_caffe_blobs.py script. Some details: I had to rename the layers in the implementation, because detectron strips off the layer names before the last / when saving the blobs to model_final.pkl. I replaced all "/"s with "-"s in the layer names. As a consequence, I also had to rename the blobs in the pretrained.pkl file. I changed one part in the pickle_caffe_blobs.py script to rename the blobs when saving to file:
I will upload everything to my fork soon, in the meantime, I hope it helps. |
Thank you so much. Good Work. I'll give a try. Edit: But it would be nice to use directly net definition from '.pb' files to retrain/finetune. This question is general to caffe2 (not detectron) |
Hi @marinaKollmitz , Awesome work. Thanks for defining CONV body method. Have you also defined a similar method for Fully connected layers? Does the method defining fully connected layer scheme has similar structure to that of VGG? Thanks again |
I just copied the VGG fully connected layers. |
@marinaKollmitz : Thanks for confirmation. I did use VGG FC layers. |
Problem solved by following recommendation at #32 to USE_NCCL True |
After training the model, I get the following errors during test.
|
Could you please explain how I can make use of that .pkl file you provided? I tried adding the code from your post (add_googlenet_xxs_conv5_body(model)) to the FPN.py file and referenced the method in the corresponding config file when using your provided .pkl file. So how did you make all of this work? Which changes do I have to make? |
Thank you very much for this great project! Could you please help me training Faster R-CNN with another backbone architecture, for example GoggleNet. I used the pickle_caffe_blobs.py script to convert the pretrained bvlc_googlenet.caffemodel to a .pkl model as mentioned at issue 77. But how can I train with it? Do I need to setup a .py file for the model like the VGG16.py in lib/modeling? Or is there a way to generate this file as well? Thank you for your help!
The text was updated successfully, but these errors were encountered: