Search code examples
tensorflowqualcommsnpe

Qualcomm SNPE sdk and SSD model


I try to use Qualcomm SNPE to integrate optimize SSD model computation on my snapdragon 820. Il succefully transform the SSD Tensorflow model to the DLC file.

There is no example of integration of SSD model I try different solution but non succes.

Does someone find example or have solution to use on snpe run net executable file?

Edit:

First when I generate the dlc model (from tensorflow model github) I get that output (which don't seem to be correct):

./snpe-tensorflow-to-dlc --graph /home/xavier/Downloads/frozen_inference_graph.pb  -i Preprocessor/sub 300,300,3 --out_node detection_classes --out_node detection_boxes --out_node detection_scores --dlc mobilenet_ssd.dlc --allow_unconsumed_nodes
2018-03-11 22:34:33.243539: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-03-11 22:34:34.505804: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1890] has already been set.
2018-03-11 22:34:34.505849: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1847] has already been set.
2018-03-11 22:34:34.505869: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2137] has already been set.
2018-03-11 22:34:34.505884: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2140] has already been set.
2018-03-11 22:34:34.505924: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2143] has already been set.
2018-03-11 22:34:34.505935: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2141] has already been set.
2018-03-11 22:34:34.505950: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2144] has already been set.
2018-03-11 22:34:34.505964: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2146] has already been set.
2018-03-11 22:34:34.505977: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2148] has already been set.
2018-03-11 22:34:34.505991: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2150] has already been set.
2018-03-11 22:34:34.506004: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[2138] has already been set.
2018-03-11 22:34:34.506020: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1851] has already been set.
2018-03-11 22:34:34.506027: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1848] has already been set.
2018-03-11 22:34:34.506036: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1850] has already been set.
2018-03-11 22:34:34.506055: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1849] has already been set.
2018-03-11 22:34:34.506483: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1857] has already been set.
2018-03-11 22:34:34.506535: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1855] has already been set.
2018-03-11 22:34:34.506539: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1853] has already been set.
2018-03-11 22:34:34.506561: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1854] has already been set.
2018-03-11 22:34:34.506547: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1856] has already been set.
2018-03-11 22:34:34.506574: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1852] has already been set.
2018-03-11 22:34:34,512 - 391 - WARNING - ERROR_TF_FALLBACK_TO_ONDEMAND_EVALUATION: Unable to resolve operation output shapes in single pass. Using on-demand evaluation!

Then I generate the ouput for snpe-net-run:

./snpe-net-run --container ./mobilenet_ssd.dlc --input_list ../../models/inception_v3/data/cropped/raw_list.txt

For each images, it generates detection_classes:0.raw file.

The file is not empty but it seems to be the same for all images.

This is an example file I get :

http://www.filedropper.com/detectionclasses0


Solution

  • You can find snpe-net-run usage in SDK/docs/html/tutorial_alexnet.html