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

Convert Tensorflow "retrained_graph.pb" and "retrained_labels.txt" to Movidius Graph

idata
Employee
1,377 Views

Hi @Tome_at_Intel ,

 

I followed this tutorial https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/index.html?index=..%2F..%2Findex#0, to classify images based on my own dataset. However, I am not able to convert the ".pb" and labels to the graph file. I have not found the exact command to generate the graph file. Would you be so kind to help me with this issue?

 

Thank You

0 Kudos
8 Replies
idata
Employee
1,058 Views

@kranok Yes I can. Can you post a link to your pb file?

0 Kudos
idata
Employee
1,058 Views
0 Kudos
idata
Employee
1,058 Views

@kranok You can use the command below to compile the graph file, however I am receiving an Index out of range error. It looks like maybe this could be because the code uses a None in the shape size and TensorFlowParser.py is trying to check the shape in line 251 (/opt/movidius/NCSDK/ncsdk-x86_64/tk/Controllers/TensorFlowParser.py). You can see the TensorFlow for Poets code is using a None for the input shape: https://github.com/googlecodelabs/tensorflow-for-poets-2/blob/master/scripts/retrain.py#L760. Can you try changing the None to a constant like 1?

 

Command to compile the network: mvNCCompile -s 12 retrained_graph.pb -in DecodeJpeg/contents -on final_result

0 Kudos
idata
Employee
1,058 Views

@kranok I forgot that there is currently a bug with the current NCSDK (1.12). This bug is preventing some custom/retrained networks from running on the NC devices. That being said we are working on a release candidate at the moment that may fix this issue, but I don't have an ETA at the moment.

0 Kudos
idata
Employee
1,058 Views

Hi @Tome_at_Intel ,

 

The training could not be done by changing the "None" to "1". It marked an error. Does the bug occur when trying the "mvNCCompile…" command?

 

I tried inputting this command: "$ mvNCCompile retrained_graph.pb -in=input/BottleneckInputPlaceholder -on=DecodeJpeg". It does generate the graph file but the classification is not done correctly.

 

Thank You,

0 Kudos
idata
Employee
1,058 Views

@kranok Thanks for the feedback. Can you do me a favor and try this: mvNCCompile retrained_graph.pb -in=input/BottleneckInputPlaceholder -on= final_result?

0 Kudos
idata
Employee
1,058 Views

@Tome_at_Intel - ran mvNCCompile retrained_graph.pb -in=input_1/BottleneckInputPlaceholder -on= final_result -o flowergraph using the poets-2 retrained_graph.pb and got the flowergraph generated. Tried using this graph in the ncs_realtime_objectdetection.py as follows: python ncs_realtime_objectdetection.py -g graphs/flowergraph -d 1

 

This does not error but there are no bounding boxes or labels. Works fine when I use the mobilenetgraph. Any idea? Appreciate your help. This is run on a RPi with a movidius NCS plugged in.
0 Kudos
idata
Employee
1,058 Views

@manopaul I'm not familiar with the ncs_realtime_objectdetection.py sample. Is this your own sample? If you can provide a link to the code, I can try to reproduce the issue and help with troubleshooting.

0 Kudos
Reply