Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Manager
257 Views

TFLearn integration into movidius

Hi,

 

I have a custom deep neural network that I developed with tensorflow and tflearn.

 

I have as an ouput file a .pb one so I guess no need to freeze it again so jumped directly to the compile step.

 

To do so I got inspired by this tutorial: https://github.com/ashwinvijayakumar/ncappzoo/tree/single-conv/tensorflow/single-conv

 

So here is the status:

 

I have a custom project located here:

 

~/worspace/ncappzoo/tensorflow/custom

 

It contains:

 

     

  • a Makefile (from tutorial evoked earlier)
  •  

  • a model dir containing my model_frozen.pb file
  •  

 

When I run a make compile, I have this error coming out: KeyError: "The name 'input:0' refers to a Tensor which does not exist. The operation, 'input', does not exist in the graph."

 

This raised several questions:

 

     

  1. My code is mainly based on tflearn can it comes from here? is is possible to use tflearn saved models on movidius?
  2.  

  3. If this comes from an input issues, where can I fix this (took a look at the Makefile but I'm new to this (makefile and tf) so this is quite blurry to me)?
  4.  

  5. Maybe I've been using the wrong way to implement my custom model on movidius (myriad 2)? Already tried to follow these advises without any success and start to be quite disapointed at this stage: https://ncsforum.movidius.com/discussion/339/is-there-a-tutorial-or-documentation-for-running-custom...
  6.  

 

Thanks for answer

 

Ragards

Tags (1)
0 Kudos
6 Replies
Highlighted
Community Manager
8 Views

My bad, after some more research, I finally used:

 

bazel-bin/tensorflow/tools/graph_transforms/summarize_graph --in_graph=/home/magaly/workspace/ncappzoo/tensorflow/model_frozen.pb

 

And then:

 

mvCCompile directly on my model_frozen.pb:

 

mvNCCompile ncappzoo/tensorflow/custom/lstm-1-layer-64.pb -in input_lstm/X -on softmax_layer/Softmax

 

Then, I have a transposition error as follow:

 

[Error 5] Toolkit Error: Stage Details Not Supported: Transpose

 

I precise that I am using an lstm (reccurent model) apparently they were not supported… > https://ncsforum.movidius.com/discussion/105/recurrent-caffe-models

 

Maybe some updates on this ?

 

M.

0 Kudos
Highlighted
Community Manager
8 Views

@malonzo Thanks for your interest in the NCS. There are some TF operations that the NCSDK still doesn't have support for and tf.transpose() is one of these operations. I wonder if you can use numpy's transpose to replace TF's transpose operation.

0 Kudos
Highlighted
Community Manager
8 Views

@Tome_at_Intel Thank you for your feedback, I will try this and let you know if it does the trick.

0 Kudos
Highlighted
Community Manager
8 Views

Hi, @Tome_at_Intel

 

Actually we decided to focus on making the inception_v3 part running on movidius as the LSTM one is not the more demanding.

 

On this, I would have a question: indeed we used to use 2015 version of inception_v3 that was published only with a .pb file (no .ckpt) this make tricky the use of mvNCCompile especially because we don't stop at the softmax layer but before. Do you have any feed-back on using it? indeed, in this version we use the pool_3/_reshape output layer that has a 2048 array output where the 2016 InceptionV3/Prediction/Reshape one has 1001. Changing the algorythm there would have a huge impact on the other part of the code and we would really ike to be able to use 2015 version.

 

Regards

 

Magaly

0 Kudos
Highlighted
Community Manager
8 Views

@malonzo You can use mvNCCompile and specify the output node with the -on option if I am understanding this correctly. This should output a graph file that uses whatever layer you specified with the -on option as the output layer. For example, if you wanted to use the pool_3/reshape output layer as the final layer for your graph file, you can use the following example command: mvNCCompile example.pb -on pool_3/reshape -s 12.

0 Kudos
Highlighted
Community Manager
8 Views

@Tome_at_Intel Thanks, it finally kind of work, there was an issue with the way to save the model which really needs to be clean.

 

As a reminder, do not forget to remove all the training variables (this is what leads to some weird errors).
0 Kudos