Conversion to uff fails but unsupported ops not in plugin list of TRT

Description

Conversion to uff fails due to unsupported ops. These ops not in custom plugin list of TRT.
How to resolve this?

Environment

TensorRT Version : 7.0.0.11
GPU Type : Tesla K80
Nvidia Driver Version : 440.64.00
CUDA Version : CUDA Version: 10.2
CUDNN Version : 7.6
Operating System + Version : Ubuntu x86_64
Python Version (if applicable) : 3.6
TensorFlow Version (if applicable) : 1.15.2
PyTorch Version (if applicable) :
Baremetal or Container (if container which image + tag) : barematel

Relevant Files


Steps To Reproduce

(base) ubuntu@usva-asd-ml-ear1:~/notebook/head-pose-estimation$ convert-to-uff frozen_graph.pb
Loading frozen_graph_optimized.pb
WARNING: Logging before flag parsing goes to stderr.
W0529 23:11:49.203099 139740564793152 module_wrapper.py:139] From /home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py:227: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

NOTE: UFF has been tested with TensorFlow 1.14.0.
WARNING: The version of TensorFlow installed on this system is not guaranteed to work with UFF.
UFF Version 0.6.5
=== Automatically deduced input nodes ===
[name: “image_tensor”
op: “Placeholder”
attr {
key: “_output_shapes”
value {
list {
shape {
dim {
size: -1
}
dim {
size: -1
}
dim {
size: -1
}
dim {
size: 3
}
}
}
}
}
attr {
key: “dtype”
value {
type: DT_FLOAT
}
}
attr {
key: “shape”
value {
shape {
dim {
size: -1
}
dim {
size: -1
}
dim {
size: -1
}
dim {
size: 3
}
}
}
}
]

=== Automatically deduced output nodes ===
[name: “layer6/final_dense”
op: “Identity”
input: “layer6/logits/BiasAdd”
attr {
key: “T”
value {
type: DT_FLOAT
}
}
attr {
key: “_output_shapes”
value {
list {
shape {
dim {
size: -1
}
dim {
size: 136
}
}
}
}
}
]

Using output node layer6/final_dense
Converting to UFF graph
DEBUG: convert reshape to flatten node
Warning: No conversion function registered for layer: TensorArrayGatherV3 yet.
Converting map/TensorArrayStack/TensorArrayGatherV3 as custom op: TensorArrayGatherV3
W0529 23:11:49.407045 139740564793152 module_wrapper.py:139] From /home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py:179: The name tf.AttrValue is deprecated. Please use tf.compat.v1.AttrValue instead.

Warning: No conversion function registered for layer: Exit yet.
Converting map/while/Exit_2 as custom op: Exit
Warning: No conversion function registered for layer: Switch yet.
Converting map/while/Switch_2 as custom op: Switch
Warning: No conversion function registered for layer: LoopCond yet.
Converting map/while/LoopCond as custom op: LoopCond
Warning: No conversion function registered for layer: LogicalAnd yet.
Converting map/while/LogicalAnd as custom op: LogicalAnd
Warning: No conversion function registered for layer: Less yet.
Converting map/while/Less_1 as custom op: Less
Warning: No conversion function registered for layer: Enter yet.
Converting map/while/Less/Enter as custom op: Enter
Warning: No conversion function registered for layer: Merge yet.
Converting map/while/Merge_1 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting map/while/NextIteration_1 as custom op: NextIteration
Warning: No conversion function registered for layer: Switch yet.
Converting map/while/Switch as custom op: Switch
Warning: No conversion function registered for layer: Merge yet.
Converting map/while/Merge as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting map/while/NextIteration as custom op: NextIteration
Warning: No conversion function registered for layer: Enter yet.
Converting map/while/Enter as custom op: Enter
Warning: No conversion function registered for layer: Switch yet.
Converting map/while/Switch_1 as custom op: Switch
Warning: No conversion function registered for layer: Enter yet.
Converting map/while/Enter_1 as custom op: Enter
Warning: No conversion function registered for layer: Less yet.
Converting map/while/Less as custom op: Less
Warning: No conversion function registered for layer: Merge yet.
Converting map/while/Merge_2 as custom op: Merge
Warning: No conversion function registered for layer: NextIteration yet.
Converting map/while/NextIteration_2 as custom op: NextIteration
Warning: No conversion function registered for layer: TensorArrayWriteV3 yet.
Converting map/while/TensorArrayWrite/TensorArrayWriteV3 as custom op: TensorArrayWriteV3
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting map/while/resize/ResizeBilinear as custom op: ResizeBilinear
Warning: No conversion function registered for layer: TensorArrayReadV3 yet.
Converting map/while/TensorArrayReadV3 as custom op: TensorArrayReadV3
Warning: No conversion function registered for layer: Enter yet.
Converting map/while/TensorArrayReadV3/Enter_1 as custom op: Enter
Warning: No conversion function registered for layer: TensorArrayScatterV3 yet.
Converting map/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3 as custom op: TensorArrayScatterV3
Warning: No conversion function registered for layer: TensorArrayV3 yet.
Converting map/TensorArray as custom op: TensorArrayV3
Warning: No conversion function registered for layer: Range yet.
Converting map/TensorArrayUnstack/range as custom op: Range
Warning: No conversion function registered for layer: Enter yet.
Converting map/while/TensorArrayReadV3/Enter as custom op: Enter
Traceback (most recent call last):
File “/home/ubuntu/anaconda3/bin/convert-to-uff”, line 10, in
sys.exit(main())
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/bin/convert_to_uff.py”, line 92, in main
debug_mode=args.debug
File “/home/ubuntu/anaconda3/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/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 178, in from_tensorflow
debug_mode=debug_mode)
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 94, in convert_tf2uff_graph
uff_graph, input_replacements, debug_mode=debug_mode)
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 79, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 41, in convert_layer
fields = cls.parse_tf_attrs(tf_node.attr)
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 222, in parse_tf_attrs
return {key: cls.parse_tf_attr_value(val) for key, val in attrs.items() if val is not None and val.WhichOneof(‘value’) is not None}
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 222, in
return {key: cls.parse_tf_attr_value(val) for key, val in attrs.items() if val is not None and val.WhichOneof(‘value’) is not None}
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 218, in parse_tf_attr_value
return cls.convert_tf2uff_field(code, val)
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 190, in convert_tf2uff_field
return TensorFlowToUFFConverter.convert_tf2numpy_dtype(val)
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 103, in convert_tf2numpy_dtype
return tf.as_dtype(dtype).as_numpy_dtype
File “/home/ubuntu/anaconda3/lib/python3.6/site-packages/tensorflow_core/python/framework/dtypes.py”, line 126, in as_numpy_dtype
return _TF_TO_NP[self._type_enum]
KeyError: 20

Please include:

  • Exact steps/commands to build your repro
  • Exact steps/commands to run your repro
  • Full traceback of errors encountered

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