Forums - Faster RCNN/MobileNet-SSD TensorFlow Models Conversion Problem

11 posts / 0 new
Last post
Faster RCNN/MobileNet-SSD TensorFlow Models Conversion Problem
champ.yen
Profile picture
Join Date: 17 May 17
Posts: 1
Posted: Tue, 2017-08-01 19:34

With the examples in SNPE SDK, I have modified and tested SNPE w/ MobileNet and Inception v1 successfully.

But I failed when I tried to convert Faster RCNN/MobileNet-SSD Models.

The pretrained models are listed here: https://github.com/GoogleCloudPlatform/tensorflow-object-detection-example

http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_...

http://download.tensorflow.org/models/object_detection/faster_rcnn_resne...

 

Follow the instructions of SNPE document, I tried to convert the model with the command:

snpe-tensorflow-to-dlc --graph ./ssd_mobilenet_v1_coco_11_06_2017/frozen_inference_graph.pb --dlc ssd_mobilenet_v1_coco_11_06_2017.dlc -i image_tensor 300,300,3 --out_node detection_boxes --out_node detection_scores --out_node detection_classes --out_node num_detections

And I got the failed log:
OUTPUT LOG:
2017-08-01 15:12:03.151858: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-01 15:12:03.151878: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-01 15:12:03.151896: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-08-01 15:12:03.151900: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-01 15:12:03.151905: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-08-01 15:12:04,845 - 125 - ERROR - Encountered Error: maximum recursion depth exceeded in cmp
Traceback (most recent call last):
  File "/home/champ/workspace/snpe-1.2.2/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 118, in main
    converter = DlcConverter(model, not args.allow_unconsumed_nodes)
  File "/home/champ/workspace/snpe-1.2.2/lib/python/converters/tensorflow/converter.py", line 309, in __init__
    self._ops = self._get_graph_operations(model)
  File "/home/champ/workspace/snpe-1.2.2/lib/python/converters/tensorflow/converter.py", line 446, in _get_graph_operations
    nodes = cls._filter_graph_nodes(model.graph_def.node, i.name, out_node_name)
  File "/home/champ/workspace/snpe-1.2.2/lib/python/converters/tensorflow/converter.py", line 492, in _filter_graph_nodes
    cls._create_sorted_node_input_graph(nodes_map, out_node, ordered_nodes_map)
  File "/home/champ/workspace/snpe-1.2.2/lib/python/converters/tensorflow/converter.py", line 517, in _create_sorted_node_input_graph
    cls._create_sorted_node_input_graph(nodes_map, input_node, ordered_nodes_map)
  ...
  File "/home/champ/workspace/snpe-1.2.2/lib/python/converters/tensorflow/converter.py", line 514, in _create_sorted_node_input_graph
    if input_node_name not in nodes_map or input_node_name in ordered_nodes_map:
RuntimeError: maximum recursion depth exceeded in cmp

Did I miss something or Did I do something wrong?

  • Up0
  • Down0
moljaca moderator
Join Date: 25 Jul 17
Location: San Diego
Posts: 40
Posted: Fri, 2017-08-04 16:54

Please see https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-neur...

Snapdragon NPE SDK 1.2.2 does not support conversion of Faster RCNN/MobileNet-SSD Models. Not all needed layers are suported. We will be adding that capability in future SDK releases. You can consider using User Defined Layer (UDL) feature of the SDK to enable currently unsupported layers, but note that UDL is currently meant primarily for prototyping and using it will have implications on runtime performance

Thanks.

 

  • Up0
  • Down0
yaochuanqi888
Join Date: 26 Jul 17
Posts: 4
Posted: Thu, 2017-08-17 02:35

Could you tell me how to convert MobileNet? Some error like this:

2017-08-17 17:28:17,244 - 388 - WARNING - WARNING_TF_SCOPE_OP_NOT_CONSUMED: Scope (MobilenetV1/MobilenetV1/Conv2d_0) operation(s) not consumed by converter: [u'Relu6'].

Thank you.

  • Up0
  • Down0
lucky.srivastava
Join Date: 17 Aug 17
Posts: 3
Posted: Wed, 2017-08-23 22:53

Hey @moljaca

I got the same error while converting mobilenet pb graph to dlc.

Runtime Error: maximum recursion depth exceeded in cmp.

As you suggested to use UDL, there's a snpe-caffe-to-dlc-udl but not for tensorflow. Could you guide me here how to go further?

Thanks.

  • Up0
  • Down0
ghorpadevish
Join Date: 20 Mar 17
Posts: 12
Posted: Wed, 2017-08-23 23:50

Hi all,

I would like to know the same udl conversion for tensorflow.

Any suggestion from qualcomm snpe team would be helpful.

Thanks and regards

vishal

  • Up0
  • Down0
moljaca moderator
Join Date: 25 Jul 17
Location: San Diego
Posts: 40
Posted: Thu, 2017-08-24 13:55

Hi,

as it stands, UDL example code in SDK needs fixing. We will need to do that first. Porting UDL specifics from snpe-caffe-to-dlc-udl example to tensorflow should be pretty straight forward. We will provide guidance once we fix udl example.

Thanks

  • Up0
  • Down0
zl1994
Join Date: 12 Aug 17
Posts: 8
Posted: Sun, 2017-09-17 07:27

Hi moljaca,
     Can you tell me what the layers in SSD that are not supported? In my opinion, there are't especial layer in SSD compared to YOLO, which can be converted to dlc file successfully.

  • Up0
  • Down0
Rex
Join Date: 8 Aug 15
Posts: 45
Posted: Fri, 2017-09-29 09:01

PriorBox layers are not supported.

  • Up0
  • Down0
lucky.srivastava
Join Date: 17 Aug 17
Posts: 3
Posted: Tue, 2017-10-03 01:13

Hi moljaca,

Can you tell me when will the example of using udl with tensorflow be available?

Thanks

  • Up0
  • Down0
zhaoyanfei226
Join Date: 28 Sep 17
Posts: 2
Posted: Mon, 2017-10-09 18:35

Hi @zl1994

Could you tell me how to convert YOLO? Are you using caffe or tensorflow?

  • Up0
  • Down0
shenyingying25
Join Date: 14 Nov 18
Posts: 19
Posted: Tue, 2018-12-25 20:44

are you resolve the problem

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