Forums - Error while converting to DLC

3 posts / 0 new
Last post
Error while converting to DLC
amith.k
Join Date: 21 Jul 21
Posts: 2
Posted: Thu, 2021-10-28 05:26

Hello,

I went back to the tutorials to follow everything to the dot to see if i can convert and get a DLC model to work properly. I used the tutorial in this link https://developer.qualcomm.com/sites/default/files/docs/snpe/convert_mobilenetssd.html, using the same model (ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03) and the same version of tensorflow (1.11). While using the command  

Quote:
snpe-tensorflow-to-dlc --input_network exported/frozen_inference_graph.pb --input_dim Preprocessor/sub 1,300,300,3 --out_node detection_classes --out_node detection_boxes --out_node detection_scores ---output_path mobilenet_ssd.dlc --show_unconsumed_nodes

i get the following errors:

Quote:
TypeError: An op outside of the function building code is being passed

a "Graph" tensor. It is possible to have Graph tensors

leak out of the function building context by including a

tf.init_scope in your function building code.

For example, the following function will fail:

  @tf.function

  def has_init_scope():

    my_constant = tf.constant(1.)

    with tf.init_scope():

      added = my_constant * 2

The graph tensor has name: Preprocessor/sub:0

 

Quote:
2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/TensorArrayWrite_1/TensorArrayWriteV3) of type (TensorArrayWriteV3) is not supported by converter.

2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/Merge) of type (Merge) is not supported by converter.

2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/Switch_1) of type (Switch) is not supported by converter.

2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Postprocessor/Decode/transpose_1/Rank) of type (Rank) is not supported by converter.

2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/Switch) of type (Switch) is not supported by converter.

2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/TensorArrayStack_1/TensorArrayGatherV3) of type (TensorArrayGatherV3) is not supported by converter.

2021-10-28 03:13:29,299 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Postprocessor/Decode/transpose_1/Range) of type (Range) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/NextIteration_1) of type (NextIteration) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Postprocessor/Decode/transpose/Rank) of type (Rank) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/NextIteration_3) of type (NextIteration) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/Merge_3) of type (Merge) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Postprocessor/Decode/transpose/Range) of type (Range) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/TensorArrayStack_1/range) of type (Range) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/Switch_3) of type (Switch) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/Exit_3) of type (Exit) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/LoopCond) of type (LoopCond) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/while/NextIteration) of type (NextIteration) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (image_tensor) of type (Placeholder) is not supported by converter.

2021-10-28 03:13:29,300 - 193 - WARNING - WARNING_TF_OP_NOT_SUPPORTED: Operation (Preprocessor/map/TensorArrayStack_1/TensorArraySizeV3) of type (TensorArraySizeV3) is not supported by converter.

 

Quote:
2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/expanded_conv_13/project/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/expanded_conv_4/depthwise/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/expanded_conv_16/project/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/expanded_conv_14/depthwise/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/expanded_conv_16/expand/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/expanded_conv_12/project/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

2021-10-28 03:13:29,303 - 193 - WARNING - WARNING_TF_LAYER_NOT_CONSUMED: Layer (FeatureExtractor/MobilenetV2/layer_19_1_Conv2d_5_1x1_64/mul_fold_ignored_ignored_ignored_ignored_ignored_ignored) of type (BatchNormalization) is not consumed by converter.

 

 

Any help is much appreciated

  • Up0
  • Down0
ap.arunraj
Join Date: 20 Apr 20
Posts: 21
Posted: Tue, 2021-11-02 01:28

Hi amith.k,

I was able to convert the model to dlc using the following command:

snpe-tensorflow-to-dlc --input_network <path_to>/exported/frozen_inference_graph.pb --input_dim Preprocessor/sub 1,300,300,3 --out_node detection_classes --out_node detection_boxes --out_node detection_scores ---output_path mobilenet_ssd.dlc --allow_unconsumed_nodes

Note: use --allow_unconsumed_nodes flag

  • Up0
  • Down0
SahilBandar
Join Date: 23 May 18
Posts: 37
Posted: Tue, 2021-11-02 05:56

Hi Amith,

In case if you are still facing the problem, Please do follow the steps given below in order to convert the model successfully.

1. Downlaod the ssd_mobilenetv2_2 model from the link given: https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2

Command used :

snpe-tensorflow-to-dlc --input_network <PATH_TO_THE_SAVED_MODEL_OF_TF> -d input_tensor 1,320,320,3 --out_node num_detections --out_node detection_boxes --out_node detection_classes --out_node detection_scores -o <MODEL_SAVEPATH.dlc>
NOTE: input node name is input_tensor.
 
2. Make sure that you have installed tensorflow 2.2 and above.
3. Make sure that you have sourced the envsetup.sh with the latest tensorflow path in order to convert the model.

Hope this will resolve your problem.

Thanks & Regards,
Sahil Bandar
  • 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.