TensorRT 6.0: No conversion function registered for layer: ResizeBilinear

Hello,
I fail converting a tensorflow frozen (.pb) graph to tensorrt, apparently because of the presence of the function tf.image.resize_bilinear in my tensorflow model

Using output node architecture/output_aggregation/truediv
Using output node architecture/output_aggregation/truediv_1
Converting to UFF graph
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer6/resize_regW as custom op: ResizeBilinear
W0927 11:59:34.076427 139874004723520 deprecation_wrapper.py:119] From /usr/local/lib/python2.7/dist-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: ResizeBilinear yet.
Converting architecture/layer5/resize_regW as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer4/resize_regW as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer3/resize_regW as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer6/resize_regB as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer5/resize_regB as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer4/resize_regB as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer3/resize_regB as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer6/resize_regL as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer5/resize_regL as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer4/resize_regL as custom op: ResizeBilinear
Warning: No conversion function registered for layer: ResizeBilinear yet.
Converting architecture/layer3/resize_regL as custom op: ResizeBilinear
DEBUG [/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.pyc:96] Marking ['architecture/output_aggregation/truediv', 'architecture/output_aggregation/truediv_1'] as outputs
No. nodes: 208
[TensorRT] ERROR: UffParser: Validator error: architecture/layer5/resize_regL: Unsupported operation _ResizeBilinear
[TensorRT] ERROR: Network must have at least one output

yet, according to the release notes TensorRT 6.0 shoud support that TF function.

I use tensorflow 1.14.1, and TensorRT 6.0.1.5.

Any idea of what am I doing wrong?

Thanks in advance,

F

I also include the code I use to do the conversion, which proved to work when no tf.resize is involved

def generate_engine(pb_file_path, out_node_list, uff_storage_path, engine_storage_path, img_height, img_width, precision='float', batch_size=1):
    GLOGGER = trt.Logger(trt.Logger.ERROR)
    with trt.Builder(G_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser:
        uff_model = uff.from_tensorflow_frozen_model(pb_file_path, out_node_list)
        with open(uff_storage_path, "w") as f:
            f.write(uff_model)

        builder.max_workspace_size = 1 << 26
        builder.max_batch_size = int(batch_size)
        builder.fp16_mode = (precision == 'half')

        input_name = "Placeholder"
        input_shape = (3, int(img_height), int(img_width))
        parser.register_input(input_name, input_shape)
        for o in out_node_list: parser.register_output(o)
        parser.parse(uff_model_path, network)

        engine = builder.build_cuda_engine(network)
        buf = engine.serialize()
        with open(engine_storage_path, "wb") as f:
            f.write(buf)

    return
1 Like

I have also met this problem.

Hi fbrughi,

So it seems that the current support matrix docs are a little misleading. The UFF parser does not support the ResizeBilinear op.

You can either try to use TF-TRT (Accelerating Inference In TF-TRT User Guide :: NVIDIA Deep Learning Frameworks Documentation), or TF-ONNX+ONNX Parser (GitHub - onnx/tensorflow-onnx: Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX) instead of the UFF Parser for converting your model to TensorRT.

For future reference, here are the supported UFF ops: UFF Operators — NVIDIA TensorRT Standard Python API Documentation 8.4.3 documentation

You can also see this post for related information: https://devtalk.nvidia.com/default/topic/1064929/tensorrt/resizebilinear/post/5393319/#5393319

Thanks,
NVIDIA Enterprise Support

1 Like