Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Unable to convert custom trained caffe model to IR

NikhilaH_Intel
Moderator
1,214 Views

Hi,

I am unable to convert my custom trained caffe model using  googlenet topology to IR.

Please find below the command used for conversion.

python mo.py --input_model ~/distdriver_caffe/googlenet_caffe_iter_2000.caffemodel --input_proto ~/distdriver_caffe/deploy.prototxt --output_dir ~/Distracteddriver_openvino/
 

The error message is as follows:

 FRAMEWORK ERROR ]  Exception message: Error parsing message

    Possible reasons:
      1. /home/u14685/distdriver_caffe/googlenet_caffe_iter_2000.caffemodel does not exist
      2. /home/u14685/distdriver_caffe/googlenet_caffe_iter_2000.caffemodel does not have a valid structure

[ FRAMEWORK ERROR ]  Model Optimizer is not able to parse /home/u14685/distdriver_caffe/googlenet_caffe_iter_2000.caffemodel

However, i am able to convert the bvlc googlenet model to IR

Please help.

Thank you
 

0 Kudos
9 Replies
Shubha_R_Intel
Employee
1,214 Views

Dear Nikhila H,

Model Optimizer Caffe Documentation (still for R1, R2 is being updated as we speak) does not specify googlenet as one of the supported topologies. I suspect this is why you've run into this error.

I actually tried it on 2019R2 (just released yesterday), and I got the same error as you.

Sorry for the inconvenience.

Shubha

0 Kudos
NikhilaH_Intel
Moderator
1,214 Views

Hi Shubha,

 

Thank you for the reply.

As per my understanding,inception v1 and googlenet is the same topology(Please correct me if i am wrong) . inception v1 is the given in the list of supported topologies and the pretrained model(bvlc googlenet) was getting converted succesfully.

Also,i tried the same with alexnet topology,but still was facing the same issue. 

Regards,

Nikhila

 

 

 

0 Kudos
Shubha_R_Intel
Employee
1,214 Views

Dear Nikhila H.

Yes my research also shows that googlenet and inception v1 are the same topology.  I just now tried Alexnet with OpenVino R2 and I had no problem.

I think you're getting your models from the wrong place. Please look at C:\Program Files (x86)\IntelSWTools\openvino_2019.2.242\deployment_tools\tools\model_downloader\list_topologies.yml and you will find alexnet as well as all the googlenet-v1 through v4 there. 

The easiest way to get these models is python downloader.py --all. But you can read the *.yml file and go to the repo directly as well.

Hope it helps,

Thanks,

Shubha

0 Kudos
NikhilaH_Intel
Moderator
1,214 Views

Dear Shubha,

As u said, the pretrained models of both the topologies (googlenet and alexnet) are getting converted successfully and is working fine . But the issue is with the fine tuned model (the custom model trained on our dataset) is having the issue.

Regards,

Nikhila

 

 

 

 

0 Kudos
Shubha_R_Intel
Employee
1,214 Views

Dear Nikhila H,

OK this is definitely believable if it's a custom-trained model. I reproduced your error on OpenVino 2019R2 using your custom-trained GoogleNet model. I will file a bug promptly. Sorry for the trouble !

Thanks,

Shubha

0 Kudos
Shubha_R_Intel
Employee
1,214 Views

Dear Nikhila H. ,

We are still looking into this problem.

Thanks !

Shubha

0 Kudos
Shubha_R_Intel
Employee
1,214 Views

Dear Nikhila H. , please find the generate_caffe_pb2.py in your openvino installation and regenerate caffe_pb2.py as below. Then retry your Model Optimizer command. Does it work ?

python "c:\Program Files (x86)\IntelSWTools\openvino_2019.2.242\deployment_tools\model_optimizer\mo\front\caffe\proto\generate_caffe_pb2.py" --input_proto caffe.proto.txt
Running: "protoc -h"
Running: "protoc caffe.proto.txt --python_out=c:\Program Files (x86)\IntelSWTools\openvino_2019.2.242\deployment_tools\model_optimizer\mo\front\caffe\proto"
File caffe_pb2.py was generated in: c:\Program Files (x86)\IntelSWTools\openvino_2019.2.242\deployment_tools\model_optimizer\mo\front\caffe\proto

 

If it still fails, then what version of Caffe did you use for the customization of the model ? Where did you get your caffe.proto file ?

Did you get your caffe.proto from https://github.com/BVLC/caffe/tree/master/src/caffe/proto ?

Please answer back on this forum.

Thanks !

Shubha

0 Kudos
NikhilaH_Intel
Moderator
1,214 Views

Dear Shubha,

Thank you so much. It worked.

I used caffe 1.1.6 , python 3.6.3 and caffe.proto from my conda environment.

 

 

0 Kudos
Shubha_R_Intel
Employee
1,214 Views

Dear Nikhila H.

Great ! Happy to hear. And thanks for reporting your success back  to this forum !

Thanks,

Shubha

0 Kudos
Reply