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
Training FasterRCNN without pre-trained network? #238
Comments
Maybe your model didn't learned anything (without initializing the model by the pre-trained model parameters). |
@manipopopo : Thank you for your answer. I understand that my trained model contain nothing. I just confuse that why the model cannot learn anything without pre-trained model). |
Hi @tiepnh , Which Even if all the |
Hi @manipopopo : Thank you for your answer. I will check those hyperparameters again. |
Hi @manipopopo : I tried training ZF without pre-trained and use the solver as below:
But, it still cannot learn anything. Can you give me some advices? |
|
Hi @manipopopo. Thank for your support.
So, it mean that, every convolution or inner_product layer in proto need to put some thing like "weight_filler { type: "gaussian" std: 0.01 }" ? |
Before starting training a model on the whole data set by 70000 iterations, you may want to experiment with a tiny training data set (2-20 images), and make sure that the model can overfit the training data set. |
Hi @manipopopo: Follow your guide, I can train the network with out pre-trained network. |
@tiepnh HI. I have same problem as you. I really appreciate you if you let me know how to modify the train.prototxt about faster-rcnn_end2end. I don't wanna use pre-trained model. So could you tell me more detail? |
@tolry418 : You should follow comment of @manipopopo before. |
@tiepnh Thanks. |
@tolry418 : I'm sorry, I sent to you the wrong prototxt file. That file just for pre-training network. These changes will make your network can learn something, not sure that the accuracy of final model is good or bad. so, you don't need change the other hyperparameter(such as iteration, learning rate,...) for now to train the new network. Just keep them are default and check that the network can leaning anything or not. |
@tiepnh Thanks for your reply. As you mentioned, i put the line like that "weight_filler { type : "gaussian" std : 0.01}" for all Convolution and Innerproduct layers in train.prototxt which is in py-faster_rcnn/models/pascal_voc/VGG16/faster_rcnn_end2end folder. like belowlayer { }BUT, i can't train it. Still have same error ... Thanks. |
@tolry418 : Can you upload your full proto file, and also faster_rcnn_end2end.sh file. |
OK. You might miss understand what i'm in now. This is the train.prototxt what i modified. name: "VGG_ILSVRC_16_layers" layer { #========= RPN ============ layer { layer { layer { layer { layer { layer { layer { #========= RoI Proposal ============ layer { layer { layer { #========= RCNN ============ layer { }This is faster_rcnn_end2end.sh set -x export PYTHONUNBUFFERED="True" GPU_ID=$1 array=( $@ ) case $DATASET in LOG="experiments/logs/faster_rcnn_end2end_${NET}_${EXTRA_ARGS_SLUG}.txt. time ./tools/train_net.py --gpu ${GPU_ID} set +x time ./tools/test_net.py --gpu ${GPU_ID} This is the extra config file what i add on original config file. EXP_DIR: faster_rcnn_end2end Thanks your help. |
@tolry418 : in faster_rcnn_end2end.sh, please remove line "--weights data/imagenet_models/${NET}.v2.caffemodel " to avoid pre-trained network. |
@tiepnh I run test on command line directly like this As i wrote above But when i run the test. Thanks your help. |
Maybe you should remove all |
@tolry418, If you still not figured about your issue, the problem might be your four first convolution layers. In your provided prototxt, you specify the learning multiplier for these layer as 0. It would cause your network to not learn anything in these layers. Since these layers are important in filtering images, it means that after 100000 of iterations you still could not learn anything. |
@tiepnh Hello, I have the problem of
And I followed above comments to modify train.prototxt by adding weight_filler and bias filler. But I still have the IndexError. Then I didn't use pretrained_model VGG16.v2.caffemodel to initialize faster r-cnn. However, I have a new error:
Can you help me to solve it? Thank you very much. |
Hi @CassieMai: |
@tiepnh Yes, I used faster_rcnn_end2end.yml, and I kept the default setting PROPOSAL_METHOD = gt. It seems config file didn't make a difference.
|
@tolry418 |
@CassieMai I met the same error,AssertionError: Selective search data not found at: |
@CassieMai @whmin I met the same error: AssertionError: Selective search data not found |
@whmin @RichardMrLu Hello, it was long time ago. I didn't remember whether I solved it, because I used a tensorflow version code instead. You may follow the above posts or try other ways. Sorry for that. |
I have a problem, why need use selective search data? We use RPN instead of selective search |
@tiepnh @manipopopo Hi, I am not sure that since the layers before conv3_1 in VGG16 are set to 0, I need add the weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 1 } to all layers in VGG16??or just the layers before conv3_1?thans for your help! |
If you don't load pretrained models, you'll need to make sure that the weights of all convolution layers are initialized with some random tensors, and all convolution layers are learnable. That is, all convolution layers in
|
@manipopopo ok~thanks I get it! And I have another question now, If I modified the train.prototxt for training, how about the test.prototxt? Do I need modify it before testing? add the wights. Thanks for your help! |
If you only change |
that's to say whether set the method to 'gt' or not,the network will use RPN ,and then get proposal ,thx @CassieMai @ujsyehao |
HI guys, I am getting this error when try to run the below script. ........~/FRCN_ROOT$ ./experiments/scripts/faster_rcnn_end2end.sh 0 VGG16
Please let me know if someone know about it... |
@ram124 Please try to run the following command |
@CassieMai Thanks for your reply. How should i specify the input file in the run command?? |
HI @CassieMai , I got this error.. What is the solution for this?? I0607 11:45:46.728519 2386 net.cpp:283] Network initialization done. I have 2 classes. Please help if someone knows this |
@ram124 It looks that you did not use parameters of ZF net to initialize your network. Have you downloaded a pre-trained model of ZF net? |
@CassieMai BUt i am getting different error now. Cannot copy param 0 weights from layer 'fc6'; shape mismatch. Source param shape is 4096 25088 (102760448); target param shape is 4096 18432 (75497472). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer. What is this?? |
Which backbone network are you using? ZF or VGG? Did you run a right .sh? |
@CassieMai |
Maybe you can check your class num? |
@CassieMai should i change the image size in dim : below?? name: "VGG_CNN_M_1024" |
@CassieMai It is running. 607 12:33:20.665174 2694 solver.cpp:229] Iteration 2900, loss = 0.411904 Where can i see the output?? How to test it on other dataset?? how long does this training runs?? train_net: "models/VGG16/faster_rcnn_end2end/train.prototxt" We disable standard caffe solver snapshotting and implement our own snapshotfunctionsnapshot: 0 We still use the snapshot prefix, thoughsnapshot_prefix: "vgg_cnn_m_1024_faster_rcnn" Please help.. |
@manipopopo @tiepnh should I use a pretrained model with classes which is different totally from classes of the model I will train? |
Do Better ImageNet Models Transfer Better? carries out experiments on classification tasks. They show
The effectness of transfer learning varies between datasets. Maybe you could try both of them (training from scratch and with pretrained models) and compare their performance on your validation dataset. If you don't have enough resources, it seems that initializing weights from pretrained models is a good choice. |
@manipopopo But i m not able to display 2 objects in single frame.. Any help is really appreciated.. Thank You |
@tiepnh @manipopopo @CassieMai @karaspd If i do training on them. During testing, Or should i fee the network with images having 2 objects???? Please clarify this. Any help is really appreciated |
See https://github.com/rbgirshick/py-faster-rcnn/blob/master/tools/demo.py#L90-L98 |
@manipopopo But how to get 2 detections in the same images |
You can save |
How to do it actually?? |
@tiepnh @manipopopo @CassieMai @karaspd I have a question regarding batch size. Can we use batch size of more than 1 in mxnet-rcnn training?? Any help is really appreciated. |
Hi, @ram124 I have the similar problem:
How did you solve it? |
I have solved it. |
it is a good way to learning net . |
Hi all,
I got the error ""BB = BB[sorted_ind, :]
IndexError: too many indices for array"
It seem that the trained network is nothing.
I follow the original steps in https://github.com/rbgirshick/py-faster-rcnn
And just modify scripts file ./experiments/scripts/faster_rcnn_end2end.sh to remove the line " --weights data/imagenet_models/${NET}.v2.caffemodel "
I can finish the training, and also make the caffemodel file.
Anyones face this error? Could you please give me the solution?
Thank you,
The text was updated successfully, but these errors were encountered: