bgshih / seglink

Detecting text by linking segments.
245 stars 74 forks source link

some tips to run the pretrained model #13

Open ZimingLu opened 6 years ago

ZimingLu commented 6 years ago

I used three days on the pretrain and here I want to share my experience with someone who are interested in this project.

Because the pretrained model is not provided, you should train it by yourself. You should download the VGG_ILSVRC_16_layers_fc_reduced_deploy.prototxt and VGG_ILSVRC_16_layers_fc_reduced.caffemodel. please pay attention to it, it is ssd vgg16 caffemodle not vgg16 model. Because there is another vgg16.tf file in the github, it is a little misleading. And for the test.py, this file is also for the vgg16 which is classification not detection. I suggest it should be deleted from the source file to avoid the misunderstanding. The most important part is that you should change the import model_vgg16 in convert_caffemodel_to_ckpt.py to import model_cnn under the seglink. Also change the path sys.path.insert(0, os.path.join(parentdir, '../../src')) to sys.path.insert(0, os.path.join(parentdir, '../../seglink'))

create network

vgg16 = model_vgg16.Vgg16Model() to

create network

vgg16 = model_cnn.SsdVgg16()

But then you will encounter another problem with weight_init_method, you should add tf.app.flags.DEFINE_string("weight_init_method", "xavier", "") in model_cnn. It will affect the train process, so I suggest to create a new model_cnn_ckpt.cy which is the copy of the model_cnn.py with tf.app.flags.DEFINE_string("weight_init_method", "xavier", "")

Please pay attention to model_scope, I have struggled with it for a longer time (maybe I am not so familiar with tensorflow 233333). All of the model_scope used here is "ssd/vgg16".

That's all what I have remembered so far. I hope these tips are useful for you and bring good luck to my current project :)

zhangyingbit commented 6 years ago

Thanks for your sharing!

Bachelorwangwei commented 5 years ago

@ZimingLu Could you shared the ssd model you trained (VGG_ILSVRC_16_layers_ssd.ckpt) THANKS!!!

BowieHsu commented 5 years ago

thanks to share