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.
6403 Discussions

Compile Keras MobileNetV2 model to Movidius graph file

idata
Employee
711 Views

I am having some problems when compiling models from Keras Application to Movidius graph file.

 

What I did:

 

     

  1. save model

     

    from keras.applications import MobileNetV2, VGG16, MobileNet from keras import backend as K mn = MobileNet() saver = tf.train.Saver() sess = K.get_session() saver.save(sess, "./mv2") tf.train.write_graph(sess.graph_def, ".", "graph.pbtxt")
  2.  

  3. use Tensorflow script to create a frozen graph

     

    python -m tensorflow.python.tools.freeze_graph --clear_devices --input_graph graph.pbtxt --input_checkpoint mv2 --output_node_names "reshape_2/Reshape" --output_graph graph.frozen.pb
  4.  

  5. convert the frozen graph to Movidius graph

     

    mvNCCompile -s graph.frozen.pb -in=input_3 -on=reshape_2/Reshape
  6.  

 

Then mvNCCompile throws: [Error 5] Toolkit Error: Stage Details Not Supported: FusedBatchNorm inputs mean and variance are not defined. The graph is not created for inference.

 

If I do the exactly the same thing for VGG16, which means replacing "mn=MobileNet()" with "mn=VGG16()", everything works perfectly, so I am assuming the error has something to do with the BatchNorm layers used in MobileNet? Any suggestion on how I can get rid of this error?
0 Kudos
2 Replies
idata
Employee
398 Views

ok, now we get that NCSDK does not support keras

0 Kudos
idata
Employee
398 Views

any news about this? I'm having a similar issue!

0 Kudos
Reply