Converting to uff using convert-to-uff api in TensorRT

I am converting tensorflow resnet-50 Frcnn pb file to uff using convert-to-uff script.

I have error as

Traceback (most recent call last):
  File "/home/itc/venv/bin/convert-to-uff", line 8, in <module>
    sys.exit(main())
  File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/convert_to_uff.py", line 92, in main
    debug_mode=args.debug
  File "/home/itc/venv/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 229, in from_tensorflow_frozen_model
    return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
  File "/home/itc/venv/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 106, in from_tensorflow
    pre.preprocess(dynamic_graph)
  File "/home/itc/TensorRT/TensorRT-7.0.0.11/samples/sampleUffFasterRCNN/config.py", line 34, in preprocess
    dynamic_graph.remove('input_2')
  File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/../../graphsurgeon/DynamicGraph.py", line 470, in remove
    nodes = self._force_to_nodes(nodes)
  File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/../../graphsurgeon/DynamicGraph.py", line 324, in _force_to_nodes
    buf = self._force_to_names(buf)
  File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/../../graphsurgeon/DynamicGraph.py", line 307, in _force_to_names
    assert False, "The name %s does not exist" % el
AssertionError: The name input_2 does not exist

When I remove input_2 in config.py, I have another error as

    Traceback (most recent call last):
      File "/home/itc/venv/bin/convert-to-uff", line 8, in <module>
        sys.exit(main())
      File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/convert_to_uff.py", line 92, in main
        debug_mode=args.debug
      File "/home/itc/venv/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 229, in from_tensorflow_frozen_model
        return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
      File "/home/itc/venv/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 110, in from_tensorflow
        gs.extras.process_dilated_conv(dynamic_graph)
      File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/../../graphsurgeon/extras.py", line 32, in process_dilated_conv
        crops = dynamic_graph.find_node_inputs_by_name(chain[-1], "crops")[0]
    IndexError: list index out of range

My config.py and pb file are attached.
config.log is config.py and plate.pb file is in the link. The pb file size is bog so I can’t attach in this fourm.
config.log (1.6 KB)

We are deprecating Caffe Parser and UFF Parser in TensorRT 7. Hence going forward, we are recommending the onnx parser path.

I will recommend you to try tf2ONNX and ONNX parser for TRT engine generation. Please refer below link:


Also, please refer to below link for working with dynamic shapes:
https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-700/tensorrt-developer-guide/index.html#work_dynamic_shapes

Thanks

I checked TensorRT7.0 documentation. It doesn’t mention that using Uff is depricated.

But what I wonder is that the pb file provided by TensorRT for sampleUffFasterRCNN and the pb model trained using Tensorflow Objectdetection framework have different layers.
pb file from sampleUffFasterRCNN has no FirstStage and SecondStage feature extractions layers. Output layers are also different.

When I convert ‘Tensorflow Objectdetection framework’s pb file’ to Uff model, I have error at

 File "/home/itc/venv/lib/python3.6/site-packages/uff/bin/../../graphsurgeon/extras.py", line 32, in process_dilated_conv
    crops = dynamic_graph.find_node_inputs_by_name(chain[-1], "crops")[0]

The two layers files are attached.Layers for faster_rcnn sample.log (16.0 KB) Layers for Tensorflow objection trained.log (279.3 KB)

Please refer to release notes " Deprecated Features" section: https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-700/tensorrt-release-notes/tensorrt-7.html#rel_7-0-0

Sample applications in TRT are just to demonstrate usage and capabilities of the TensorRT platform. You might have to make some changes and if required add to custom plugin layer for unsupported layers in your model.

Thanks