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
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:
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
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.
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
Hi amith.k,
I was able to convert the model to dlc using the following command:
Note: use --allow_unconsumed_nodes flag
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
Hope this will resolve your problem.
Thanks & Regards,
Sahil Bandar