Forums - Error: while converting (keras_retinanet model to .dlc file) using snpe-tensorflow-to-dlc

4 posts / 0 new
Last post
Error: while converting (keras_retinanet model to .dlc file) using snpe-tensorflow-to-dlc
csiitism
Join Date: 31 Oct 19
Posts: 6
Posted: Thu, 2019-10-31 07:38

Details:

keras:  2.2.4

tensorflow for training:  2.0.0 

converted .h5 file to .pb  using tensorflow: 1.6.0

SNPE:  snpe-1.19.2

ubuntu-14 with tensorflow: 1.6.0, and python 2.7

 

I am using this command:

 

snpe-tensorflow-to-dlc --graph /home/chandan/Documents/snpe/models/output_model.pb --input_dim input_1_2 1,224,224,3 --out_node filtered_detections_2/map/TensorArrayStack/TensorArrayGatherV3 --out_node filtered_detections_2/map/TensorArrayStack_1/TensorArrayGatherV3 --out_node filtered_detections_2/map/TensorArrayStack_2/TensorArrayGatherV3 --dlc /home/chandan/Documents/snpe/models/output_model.dlc --allow_unconsumed_nodes

 

ERROR:

 

2019-10-31 13:17:47.249405: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1542] has already been set.
2019-10-31 13:17:47.249526: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1548] has already been set.
2019-10-31 13:17:47.249589: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1547] has already been set.
2019-10-31 13:17:47.249652: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1543] has already been set.
2019-10-31 13:17:47.249711: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1544] has already been set.
2019-10-31 13:17:47.249810: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1594] has already been set.
2019-10-31 13:17:47.249882: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1591] has already been set.
2019-10-31 13:17:47.249956: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1601] has already been set.
2019-10-31 13:17:47.250032: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1599] has already been set.
2019-10-31 13:17:47.250113: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1597] has already been set.
2019-10-31 13:17:47.250249: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1592] has already been set.
2019-10-31 13:17:47.405363: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1595] has already been set.
2019-10-31 13:17:47.425089: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1552] has already been set.
2019-10-31 13:17:47.425139: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1551] has already been set.
2019-10-31 13:17:47.427324: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1554] has already been set.
2019-10-31 13:17:47.427348: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1553] has already been set.
2019-10-31 13:17:47.427414: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1550] has already been set.
2019-10-31 13:17:47.427428: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1549] has already been set.
2019-10-31 13:17:47,435 - 393 - WARNING - ERROR_TF_FALLBACK_TO_ONDEMAND_EVALUATION: Unable to resolve operation output shapes in single pass. Using on-demand evaluation!
2019-10-31 13:19:22,606 - 106 - ERROR - Conversion failed: ElementWise resolver must implement broadcast method.

 

 

 

 

  • Up0
  • Down0
gesqdn-forum
Join Date: 4 Nov 18
Posts: 184
Posted: Tue, 2019-11-05 03:20

Hi
For your information SNPE supports only the following frameworks Caffe, Caffe2, ONNXTM, and TensorFlowTM.
Rather than converting the Keras model into TensorFlow and converting it to DLC, we suggest using TensorFlow Framework.

You can go through the below link which lists out all the layers and activation functions supported by SNPE,
https://developer.qualcomm.com/docs/snpe/network_layers.html

  • Up0
  • Down0
csiitism
Join Date: 31 Oct 19
Posts: 6
Posted: Tue, 2019-11-05 22:29

Thankyou for response 

  • Up0
  • Down0
csiitism
Join Date: 31 Oct 19
Posts: 6
Posted: Tue, 2019-11-05 23:46

Hi,

 

Problem:  What command parameters should i give for multiple outputs (as i have [boxes,scores, labels] in my model)?

also for my model the input shape is (? , ?, ?, 3) with name input_1

I updated the version of SNPE as SNPE-1.31.0 

I was trying with following command:

snpe-tensorflow-to-dlc --graph /home/chandan/Documents/snpe/models/out_model1.pb --input_dim input_1 1,224,224,3 --out_node filtered_detections/map/TensorArrayStack/TensorArrayGatherV3 --out_node filtered_detections/map/TensorArrayStack_1/TensorArrayGatherV3 --out_node filtered_detections/map/TensorArrayStack_2/TensorArrayGatherV3 --dlc /home/chandan/Documents/snpe/models/out_model1.dlc --allow_unconsumed_nodes

now i am gettting error:

2019-11-04 14:36:18,000 - 175 - WARNING - Option: '--dlc' is DEPRECATED and will be removed in upcoming release. Please use '--output_path', '-o'
2019-11-04 14:36:18,000 - 175 - WARNING - Option: '--graph' is DEPRECATED and will be removed in upcoming release. Please use '--input_path', '-i'
2019-11-04 14:36:18.001569: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-11-04 14:36:25.114553: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1522] has already been set.
2019-11-04 14:36:25.114674: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1528] has already been set.
2019-11-04 14:36:25.114742: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1527] has already been set.
2019-11-04 14:36:25.114823: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1523] has already been set.
2019-11-04 14:36:25.114886: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1524] has already been set.
2019-11-04 14:36:25.114990: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1553] has already been set.
2019-11-04 14:36:25.115067: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1550] has already been set.
2019-11-04 14:36:25.115145: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1556] has already been set.
2019-11-04 14:36:25.179434: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1551] has already been set.
2019-11-04 14:36:25.675460: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1554] has already been set.
2019-11-04 14:36:25.676226: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1530] has already been set.
2019-11-04 14:36:25.676299: W tensorflow/core/framework/op_kernel.cc:1202] OP_REQUIRES failed at function_ops.cc:80 : Internal: Retval[1529] has already been set.
2019-11-04 14:36:25,681 - 411 - WARNING - ERROR_TF_FALLBACK_TO_ONDEMAND_EVALUATION: Unable to resolve operation output shapes in single pass. Using on-demand evaluation!
2019-11-04 14:36:25,799 - 170 - INFO - INFO_ALL_BUILDING_NETWORK:
Building Network
2019-11-04 14:36:25,799 - 170 - INFO - INFO_TF_BUILDING_INPUT_LAYER: Building layer (INPUT) with node: input_1_2, shape [1, 224, 224, 3]
**2019-11-04 14:37:23,803 - 165 - ERROR - Conversion failed: Cannot find bboxes or scores**

 

 

**Configuration for training model:**

Keras: 2.2.4
Tensorflow 1.19.0
Python 3.6
:::output format : .H5

**Configuration for .h5 to .pb (keras to tensorflow) :**
Keras: 2.2.4
Tensorflow: 1.16.0
Python: 2.7

**Configuration for .pb to .dlc :**
Command for conversion:
***snpe-tensorflow-to-dlc --graph /home/chandan/Documents/snpe/models/out_model1.pb --input_dim input_1 1,224,224,3 --out_node filtered_detections/map/TensorArrayStack/TensorArrayGatherV3 --out_node filtered_detections/map/TensorArrayStack_1/TensorArrayGatherV3 --out_node filtered_detections/map/TensorArrayStack_2/TensorArrayGatherV3 --dlc /home/chandan/Documents/snpe/models/out_model1.dlc --allow_unconsumed_nodes***

Using SNPE: Snapdragon Neural Processing Engine SDK
SNPE. snpe-1.31.0.522
Python: 2.7
Tensorflow: 1.16.0
Keras: 2.2.4
**- > ERROR - Conversion failed: Cannot find bboxes or scores**

 

  • 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.