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 encountered: Unknown layer type encountered: 4 for VGG-16 laycer CNN #39

Closed
StephenBydawell opened this issue Jun 13, 2016 · 8 comments

Comments

@StephenBydawell
Copy link

Using the command: ./convert.py VGG_ILSVRC_16_layers_deploy.prototxt --code-output-path=mynet.py

.prototxt obtained from: https://gist.github.com/ksimonyan/211839e770f7b538e2d8

@SepehrV
Copy link

SepehrV commented Jun 13, 2016

The problem is with the version of Caffe that your prototxt file is written for.
In more recent versions of Caffe, some syntax for prototxt files has changed. E.g. layers changed to layer or now the type of layers is a string.
So to solve the issue you can simply modify the prototxt file so that it would be compatible with latest release of Caffe.

To do so, apply these changes:

layers -> layer
CONVOLUTION -> "Convolution"
POOLING -> "Pooling"
RELU -> "ReLU"
INNER_PRODUCT -> "InnerProduct"
SOFTMAX -> "Softmax"
DROPOUT -> "Dropout"
LRN -> "LRN"

@StephenBydawell
Copy link
Author

Thanks for your response. I implemented the changes and now have this error:

xt_format.py", line 764, in ConsumeIdentifier
raise self._ParseError('Expected identifier.')
google.protobuf.text_format.ParseError: 1:1 : Expected identifier.

I changed the attached .prototxt to .txt
VGG_ILSVRC_16_layers_deploy.txt

Your assistance is much appreciated.

@ethereon
Copy link
Owner

I'd recommend using the upgrade_net_proto_text and upgrade_net_proto_binary tools bundled with Caffe for updating the .prototxt and .caffemodel files respectively, as described in the readme.

@StephenBydawell
Copy link
Author

Managed to get a new .prototxt. Thanks for the help.

@Yaffa1607
Copy link

Hi , I do not have caffe , I was wondering if someone can upgrade a prototxt file and share?
I'm trying to convert this caffe model to tensprflow. http://vision.soic.indiana.edu/egohands_files/hand_classifier.prototxt

@Serhiy-Shekhovtsov
Copy link

Serhiy-Shekhovtsov commented Jan 20, 2017

@Yaffa1607 have you ever got the hand_classifier.prototxt converted?

@geoffzhang
Copy link

Hi, @SepehrV , Do you have the problem of "Error encountered: Unknown layer type encountered: Normalize", can you give me some advice, please?

@sumaira-hussain
Copy link

Hi
I am using same command to convert my caffe model into tensorflow. I have updated my both prototxt and caffemodel files. but still I am getting this error.
image

can anybody tell what is wrong?

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

7 participants