Forums - Failed Conversion of MobileNet SSD with SNPE 1.37.0

6 posts / 0 new
Last post
Failed Conversion of MobileNet SSD with SNPE 1.37.0
gexf2
Join Date: 6 Apr 20
Posts: 7
Posted: Wed, 2020-05-06 01:12

Hi,

I followed the steps in https://developer.qualcomm.com/docs/snpe/convert_mobilenetssd.html to test the SNPE interface, but I failed.

I am working on a docker enviroment ubuntu 16.04.

Python 3.5.2

Tensorflow 1.15

snpe-1.37.0.788

snpe-tensorflow-to-dlc --input_network ~/download_models/exported/frozen_inference_graph.pb --input_dim Preprocessor/sub 1,300,300,3 --out_node detection_boxes --out_node detection_classes --out_node detection_scores  --out_node num_detections  -o /tmp/tflite/mobilenet_ssd.dlc --allow_unconsumed_nodes

log info:

WARNING:tensorflow:From /root/snpe-sdk/snpe-1.37.0.788/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc:33: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2020-05-06 06:06:09,501 - 139 - WARNING - From /root/snpe-sdk/snpe-1.37.0.788/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc:33: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

WARNING:tensorflow:From /root/snpe-sdk/snpe-1.37.0.788/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc:33: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2020-05-06 06:06:09,501 - 139 - WARNING - From /root/snpe-sdk/snpe-1.37.0.788/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc:33: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2020-05-06 06:06:09.502005: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-05-06 06:06:09.524586: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3600000000 Hz
2020-05-06 06:06:09.524965: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4eb1a30 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-05-06 06:06:09.524989: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-05-06 06:06:09.526157: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /root/snpe-sdk/snpe-1.37.0.788/lib/x86_64-linux-clang:/root/snpe-sdk/snpe-1.37.0.788/lib/x86_64-linux-clang:/root/snpe-sdk/snpe-1.37.0.788/lib/x86_64-linux-clang:/root/snpe-sdk/snpe-1.37.0.788/lib/x86_64-linux-clang:
2020-05-06 06:06:09.526175: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2020-05-06 06:06:09.526195: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: a1db66e8fb91
2020-05-06 06:06:09.526204: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: a1db66e8fb91
2020-05-06 06:06:09.526226: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:200] libcuda reported version is: Not found: was unable to find libcuda.so DSO loaded into this program
2020-05-06 06:06:09.526257: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:204] kernel reported version is: 430.64.0
WARNING:tensorflow:From /root/snpe-sdk/snpe-1.37.0.788/lib/python/snpe/converters/tensorflow/loader.py:147: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.

2020-05-06 06:06:09,526 - 139 - WARNING - From /root/snpe-sdk/snpe-1.37.0.788/lib/python/snpe/converters/tensorflow/loader.py:147: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.

2020-05-06 06:06:12.555948: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7872] has already been set.
2020-05-06 06:06:12.555948: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7874] has already been set.
2020-05-06 06:06:12.556052: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7893] has already been set.
2020-05-06 06:06:12.555948: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7881] has already been set.
2020-05-06 06:06:12.555948: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7879] has already been set.
2020-05-06 06:06:12.556115: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7873] has already been set.
2020-05-06 06:06:12.556133: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7875] has already been set.
2020-05-06 06:06:12.556145: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7880] has already been set.
2020-05-06 06:06:12.556107: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7877] has already been set.
2020-05-06 06:06:12.556110: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7882] has already been set.
2020-05-06 06:06:12.556178: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at function_ops.cc:69 : Internal: Retval[7878] has already been set.
2020-05-06 06:06:12,658 - 411 - WARNING - ERROR_TF_FALLBACK_TO_ONDEMAND_EVALUATION: Unable to resolve operation output shapes in single pass. Using on-demand evaluation!
2020-05-06 06:06:12,663 - 169 - INFO - INFO_ALL_BUILDING_NETWORK:
==============================================================
Building Network
==============================================================
2020-05-06 06:22:48,545 - 169 - INFO - INFO_DLC_SAVE_LOCATION: Saving model at /tmp/tflite/mobilenet_ssd.dlc
2020-05-06 06:22:48,554 - 169 - INFO - INFO_CONVERSION_SUCCESS: Conversion completed successfully

Although it shows the success, but the dlc file is only 4kb in size.

-rw-r--r-- 1 root root    4668 May  6 06:22 mobilenet_ssd.dlc

And the dlc can not be used in my application,  is it a proiblem arising from the conversion process due to the waining?

What should I do? thanks for any replies.

Feng

  • Up0
  • Down0
jonghoon
Join Date: 28 Apr 20
Posts: 5
Posted: Mon, 2020-05-11 23:43

I think you can change tensorflow version from 1.15 to 1.14

cheers

  • Up0
  • Down0
gexf2
Join Date: 6 Apr 20
Posts: 7
Posted: Wed, 2020-05-13 23:08
Hi Jonghoon,
 
According to your prompt I got the correct dlc file, thank you very much for your reply.
 
I am a beginner in this field, could you help explain the reason why the problem can be solved after downgrading the tensorflow version?
 
Now I have another confusion, after application imports dlc, the data of the parsing output layer depends on the label.txt, but it is not included in the file (ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03.tar.gz). How do I get this label file that works with dlc?
 
Experts are welcome to enlighten me.
 
Thanks,
  • Up0
  • Down0
jonghoon
Join Date: 28 Apr 20
Posts: 5
Posted: Thu, 2020-05-14 02:19

Hi gexf2

I had same things.

you can make the label.txt file from labelmap.txt of mobilenet ssd model in tensorflow object detection 

cheers

 

 

 

  • Up0
  • Down0
gexf2
Join Date: 6 Apr 20
Posts: 7
Posted: Thu, 2020-05-14 17:32

Thank you very much, Jonghoon.

  • Up0
  • Down0
webspaceteam1
Join Date: 9 Feb 21
Posts: 1
Posted: Wed, 2021-02-10 00:14

Many thanks Jonghoon! I also faced such a problem and your advice helped me)

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.