weiliu89 / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
4.77k stars 1.68k forks source link

How to finetune VGG_coco_SSD_300x300_iter_400000.caffemodel using my own dataset? #603

Open sangthian opened 7 years ago

sangthian commented 7 years ago

I want to finetune existed SSD caffemodel using my own dataset, so downloaded models_VGGNet_VOC0712_SSD_300x300_ft.tar.gz, I tried to modify the finetune_ssd_pascal.py. I replaced with my own dataset(4 classes: car, pedestrian, truck, cyclist), but I met mistake as follows, what should I do or modify something? @weiliu89

Cannot copy param 0 weights from layer 'conv4_3_norm_mbox_conf'; shape mismatch.  Source param shape is 324 512 3 3 (1492992); target param shape is 16 512 3 3 (73728). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.
*** Check failure stack trace: ***
    @     0x7f0bddd2f5cd  google::LogMessage::Fail()
    @     0x7f0bddd31433  google::LogMessage::SendToLog()
    @     0x7f0bddd2f15b  google::LogMessage::Flush()
    @     0x7f0bddd31e1e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f0bde5c34cb  caffe::Net<>::CopyTrainedLayersFrom()
    @     0x7f0bde5ca225  caffe::Net<>::CopyTrainedLayersFromBinaryProto()
    @     0x7f0bde5ca2be  caffe::Net<>::CopyTrainedLayersFrom()
    @           0x40a849  CopyLayers()
    @           0x40bca4  train()
    @           0x4077c8  main
    @     0x7f0bdc4c6830  __libc_start_main
    @           0x408099  _start
    @              (nil)  (unknown)
Aborted (core dumped)
Bardo91 commented 7 years ago

Maybe these links can help you:

sangthian commented 7 years ago

@Bardo91 I know how to train my own dataset(finetune from VGG_ILSVRC_16_layers_fc_reduced.caffemodel) I want to know how to solve the problem above.

Bardo91 commented 7 years ago

Can you upload the python file? I am not an expert but maybe I can find something that helps

weiliu89 commented 7 years ago

You can specify conf_postfix in the CreateMultiBoxHead() function. Search it. Someone asked this question before.

sangthian commented 7 years ago

@weiliu89 thanks very much, you solved the problem! it is useful to add the parameter in that function.

sidgan commented 6 years ago

@Jmx5200 Can you please point out the location of the file finetune_ssd_pascal.py?