Skip to content
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

Error-when converting a .caffemodel file to a Keras #4

Closed
TrungHieu-Le opened this issue May 7, 2018 · 3 comments
Closed

Error-when converting a .caffemodel file to a Keras #4

TrungHieu-Le opened this issue May 7, 2018 · 3 comments

Comments

@TrungHieu-Le
Copy link

Hello Pierluigiferrari and everyone,
I want to convert an FSSD.caffe model (COCO models - https://github.com/lzx1413/CAFFE_SSD/tree/fssd) to an HDF5 file (keras).
I use Python = 3.6.5, caffe =1.0, h5py = 2.7.1 which are installed by anaconda3
I follow your source code and here is code that I wrote:

from caffe_weight_converter import convert_caffemodel_to_keras, convert_caffemodel_to_dict
output_filename = './output'
prototxt_filename = './models/deploy.prototxt'
caffemodel_filename = './models/VGG_coco_SSD_300x300_iter_400000.caffemodel'
cm = convert_caffemodel_to_keras(output_filename,
prototxt_filename,
caffemodel_filename,
include_layers_without_weights=False,
include_unknown_layer_types=True,
keras_backend='tf',
verbose=True)
When running source code I got error:

[libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 814:14: Message type "caffe.LayerParameter" has no field named "norm_param".
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0507 20:49:23.393383 25808 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: /media/hieu/Data/Deep_leaning/Keras/convert_caffe_to_keras/caffe_weight_converter-master/models/deploy.prototxt
*** Check failure stack trace: ***

Please help me to solve this error
Thank you very much!

@pierluigiferrari
Copy link
Owner

pierluigiferrari commented May 12, 2018

You haven't installed Caffe properly and/or installed the wrong version. Note that you must install the correct version of Caffe that the model requires that you are trying to convert.

The issue you're having has already been solved before in #3.

@TrungHieu-Le
Copy link
Author

Hello Pierluigiferrar,
Thank for your reply.
Maybe I installed the wrong version.
Thank you!

@pierluigiferrari
Copy link
Owner

You're welcome and good luck! Check the repository of the Caffe model you're trying to convert, it probably comes with some instructions as to which Caffe version to install and how to install it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants