[TensorRT] ERROR: UFFParser: Parser error: resnet_model/batch_normalization/FusedBatchNorm: reshape weights failed!

I’m attempting to convert a frozen TF model into UFF and encountered this issue. Any advice?

import tensorrt as trt
# Import TensorRT Modules
import uff
from tensorrt.parsers import uffparser

# Load frozen tensorflow model and convert it to UFF model
output = 'nn_loss/transpose'
uff_model = uff.from_tensorflow_frozen_model('freeze.pb', [output])

# Configure the uff parser
parser = uffparser.create_uff_parser()
parser.register_input("data_feeder_input/input_var",(4,1280,960), 0)
parser.register_output(output)

# Create engine
G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.ERROR)
engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 20 )

parser.destroy()

Log:

Using output node nn_loss/transpose
Converting to UFF graph
Warning: keepdims is ignored by the UFF Parser and defaults to True
Warning: keepdims is ignored by the UFF Parser and defaults to True
Warning: keepdims is ignored by the UFF Parser and defaults to True
No. nodes: 909
[TensorRT] ERROR: Parameter check failed at: Utils.cpp::reshapeWeights::71, condition: input.values != nullptr
[TensorRT] ERROR: UFFParser: Parser error: resnet_model/batch_normalization/FusedBatchNorm: reshape weights failed!
[TensorRT] ERROR: Failed to parse UFF model stream
  File "/home/alex/.pyenv/versions/3.5.5/lib/python3.5/site-packages/tensorrt/utils/_utils.py", line 255, in uff_to_trt_engine
    assert(parser.parse(stream, network, model_datatype))
Traceback (most recent call last):
  File "/home/alex/.pyenv/versions/3.5.5/lib/python3.5/site-packages/tensorrt/utils/_utils.py", line 255, in uff_to_trt_engine
    assert(parser.parse(stream, network, model_datatype))
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "convert_to_tensorrt.py", line 17, in <module>
    engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 20 )
  File "/home/alex/.pyenv/versions/3.5.5/lib/python3.5/site-packages/tensorrt/utils/_utils.py", line 263, in uff_to_trt_engine
    raise AssertionError('UFF parsing failed on line {} in statement {}'.format(line, text))
AssertionError: UFF parsing failed on line 255 in statement assert(parser.parse(stream, network, model_datatype))

I encountered the same problem. Have you solved it?

me too,have you solved the problem? thx!