Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Caffe_translator: This translation script only accepts new style layers that are stored in the layer field. #823

Open
Michael-Jing opened this issue Jun 19, 2017 · 4 comments

Comments

@Michael-Jing
Copy link

I am trying to convert an caffe trained model to caffe2, and I see the following errer message,

ValueError: I think something is wrong. This translation script only
accepts new style layers that are stored in the layer field.

So what might be the issues, what could I do if I want to translator the pre-trained model.

@ezineo
Copy link
Contributor

ezineo commented Jun 19, 2017

That seems you should update your caffe prototxt from V1 to V2, esp. the Input layer.

@Michael-Jing
Copy link
Author

Michael-Jing commented Jun 19, 2017

@ezineo how can I do that, is there a tool available, or sholud I do it manually?

@slayton58
Copy link
Contributor

https://github.com/BVLC/caffe/blob/master/tools/upgrade_net_proto_text.cpp sounds like it does what you want.

@xzhewei
Copy link

xzhewei commented Apr 19, 2018

I have the same problem.
First, clone caffe. You should know how to build caffe, e.g modified Makefile.config

git clone https://github.com/BVLC/caffe.git
cd caffe
make

Use tools to upgrade prototxt and caffemodel

cd build/tools
xuzhewei@LabServer000:~/lib/caffe-1.0/build/tools$ ./upgrade_net_proto_text /home/all/models/VGG_ILSVRC_16_layers_deploy.prototxt /home/all/models/VGG_ILSVRC_16_layers_deploy_V1.prototxt
I0419 14:14:13.562763 23401 upgrade_proto.cpp:53] Attempting to upgrade input file specified using deprecated V1LayerParameter: /home/all/models/VGG_ILSVRC_16_layers_deploy.prototxt
I0419 14:14:13.563534 23401 upgrade_proto.cpp:61] Successfully upgraded file specified using deprecated V1LayerParameter
I0419 14:14:13.563611 23401 upgrade_proto.cpp:67] Attempting to upgrade input file specified using deprecated input fields: /home/all/models/VGG_ILSVRC_16_layers_deploy.prototxt
I0419 14:14:13.563650 23401 upgrade_proto.cpp:70] Successfully upgraded file specified using deprecated input fields.
W0419 14:14:13.563665 23401 upgrade_proto.cpp:72] Note that future Caffe releases will only support input layers and not input fields.
I0419 14:14:13.564394 23401 upgrade_net_proto_text.cpp:49] Wrote upgraded NetParameter text proto to /home/all/models/VGG_ILSVRC_16_layers_deploy_V1.prototxt
xuzhewei@LabServer000:~/lib/caffe-1.0/build/tools$ ./upgrade_net_proto_binary /home/all/models/VGG_ILSVRC_16_layers.caffemodel /home/all/models/VGG_ILSVRC_16_layers_V1.caffemodel
I0419 14:15:38.643944 24177 upgrade_proto.cpp:53] Attempting to upgrade input file specified using deprecated V1LayerParameter: /home/all/models/VGG_ILSVRC_16_layers.caffemodel
I0419 14:15:40.964524 24177 upgrade_proto.cpp:61] Successfully upgraded file specified using deprecated V1LayerParameter
I0419 14:15:40.993201 24177 upgrade_proto.cpp:67] Attempting to upgrade input file specified using deprecated input fields: /home/all/models/VGG_ILSVRC_16_layers.caffemodel
I0419 14:15:40.993227 24177 upgrade_proto.cpp:70] Successfully upgraded file specified using deprecated input fields.
W0419 14:15:40.993252 24177 upgrade_proto.cpp:72] Note that future Caffe releases will only support input layers and not input fields.
I0419 14:15:41.512004 24177 upgrade_net_proto_binary.cpp:48] Wrote upgraded NetParameter binary proto to /home/all/models/VGG_ILSVRC_16_layers_V1.caffemodel

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

No branches or pull requests

4 participants