Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
419 Views

Compile Keras MobileNetV2 model to Movidius graph file

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?
Tags (1)
0 Kudos
2 Replies
idata
Community Manager
106 Views

ok, now we get that NCSDK does not support keras

idata
Community Manager
106 Views

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

Reply