My tensorflow model was from the tensorflow/models repository: https://github.com/tensorflow/models/blob/6f1e3b38d80f131e21f0721196df7cfc5ced2b74/research/deeplab/g3doc/model_zoo.md.
I have successfully converted the model by using commond below:
cmd = ['snpe-tensorflow-to-dlc','--input_path', os.path.join(tensorflow_dir, pb_filename),'--input_dim', 'ImageTensor', '1,1025,2049,3','--out_node', 'Cast','--output_path', os.path.join(dlc_dir, MODEL_DLC_FILENAME),'--allow_unconsumed_nodes']
the convertion log is shown below:
INFO: Converting model_pretrained_citys_1025.pb to SNPE DLC format2019-11-13 02:53:06,764 - 175 - WARNING - Option: '--dlc' is DEPRECATED and will be removed in upcoming release. Please use '--output_path', '-o'2019-11-13 02:53:06,764 - 175 - WARNING - Option: '--graph' is DEPRECATED and will be removed in upcoming release. Please use '--input_path', '-i'2019-11-13 02:53:06.766102: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA2019-11-13 02:53:08,179 - 411 - WARNING - ERROR_TF_FALLBACK_TO_ONDEMAND_EVALUATION: Unable to resolve operation output shapes in single pass. Using on-demand evaluation!2019-11-13 02:53:08,181 - 170 - INFO - INFO_ALL_BUILDING_NETWORK:==============================================================Building Network==============================================================2019-11-13 02:53:08,182 - 170 - INFO - INFO_TF_BUILDING_INPUT_LAYER: Building layer (INPUT) with node: ImageTensor, shape [1, 1025, 2049, 3]2019-11-13 02:53:12,172 - 170 - INFO - INFO_DLC_SAVE_LOCATION: Saving model at /root/snpe-1.31.0.522/models/mnv2_dlv3/dlc/model_pretrained_citys_1025.dlc2019-11-13 02:53:12,176 - 170 - INFO - INFO_CONVERSION_SUCCESS: Conversion completed successfullyINFO: Setup deeplab v3 completed.*/
then when I run commond `$SNPE_ROOT/examples/NativeCpp/SampleCode/obj/local/x86_64-linux-clang/snpe-sample -b ITENSOR -d ../dlc/model_pretrained_citys_1025.dlc -i target_raw_list.txt -o output` to test my converted model, I got the error message:
Error while building SNPE object.
Which means the 'setBuilderOptions(container, runtime, runtimeList, udlBundle, useUserSuppliedBuffers, platformConfig, usingInitCaching);' step did not succeed.
I've also tried to run 'snpe-net-run --container ../dlc/model_pretrained_citys_1025.dlc --input_list target_raw_list.txt', which was followed by error message like this:
error_code=403; error_message=No output is defined. Network has empty outputs; error_component=Dl Network; line_no=302; thread_id=139974530858880
I have tested the tutorial of inceptionV3 with the same pipeline, which works well. I'm wondering why the program cannot find my output node since I have specified my output node name when converting the model.
Wish somebody could help me!
*/
Hi,
I have tried converting the model you mentioned in the link.
the flag "--allow_unconsumed_nodes", allows you to convert the model to DLC excluding the unsupported layers.
We tried to convert the given model using the below command,
Faced following error,
The error is because the model consists of layers that SNPE doesn't support. You can find the SNPE supported layer information from the below link
https://developer.qualcomm.com/docs/snpe/network_layers.html
thank you for your reply!
In fact I have noticed this, and I removed the unsupported operations such as 'toFloat' and 'tf.image.resize with align_corner=True', etc. I have also convert the dtype of original placeholder from uint8 to float32. But I got an even more weird error, which makes me confused again.
When I convert my new .pb file to .dlc file, the following error log showed up: