how can I retrain my caffamodel ?

272 views
Skip to first unread message

Mahek Vasoya

unread,
Feb 11, 2020, 8:51:58 AM2/11/20
to Caffe Users
I am having a MobileNetSSD_deploy.caffemodel and MobileNetSSD_deploy.prototxt  which is capable of detecting basic objects. I want to retrain that model to detect my custom objects. How can I start doing so?
Capture.JPG

Bhargava Narendra

unread,
Feb 11, 2020, 8:59:21 AM2/11/20
to Caffe Users
write a solver prototxt file with 'net' argument pointing to your prototxt file in which the network is defined. And use the weights to train the network by
 giving the path to your caffemodel to the weights flag in the commandline

Mahek Vasoya

unread,
Feb 11, 2020, 9:42:11 AM2/11/20
to Caffe Users
Can you guide me through the steps for it.. I am just a beginner. 

Bhargava Narendra

unread,
Feb 12, 2020, 12:01:04 AM2/12/20
to Caffe Users
Well first of all I do not think you can train a model using the deploy.prototxt because it does not include the phase:Test in general. Do you mind sharing the prototxt file screenshot of the data layers and last 2 or 3 layers so that I can tell you if you can use it for training or not and if you can use it I could tell you the necessary steps you need to take to retrain(called transfer learning when training a model that is already trained with another dataset).

Mahek Vasoya

unread,
Feb 12, 2020, 3:21:59 AM2/12/20
to Caffe Users
I have attached both caffemodel file and prototxt file please have a look.
MobileNetSSD_deploy.prototxt.txt

Bhargava Narendra

unread,
Feb 12, 2020, 3:41:36 AM2/12/20
to Caffe Users
You cannot use this prototxt as it is for training as there is no 'phase: train' involved in the prototxt. This prototxt is used for inference, You cannot use it for training. Please find the prototxt file that was used for training and use that file or rewrite the deploy.prototxt file so that it has training phase.
To rewrite please refer to the train_test.prototxt I have attached (see line 8 and line 144). This file is provided by Xilinx and to use this you need special caffe framework that is provided by xilinx to run it. So I suggest you to rewrite your prototxt file by taking train_test.prototxt as reference or else refer caffe tutorials on how to write a prototxt file.
train_test.prototxt
Reply all
Reply to author
Forward
0 new messages