Hello again.
I fixed the error with batch normalization by removing all batch normalization layers.
However, I still cannot create the engine. I use reshape to change tensors with dimensions (None, 64, 26, 26) to (None, 256, 13, 13), where the dimensions are in NCHW format. After that, there is a concatenate layer that merges the tensor (None, 256, 13, 13) with a tensor with dimension (None, 1024, 13, 13). The output of the concatenate layer has the dimensions (None, 1280, 13, 13).
To freeze the network and create the UFF file I use the following code:
checkpoint_prefix = os.path.join(‘.’, “saved_checkpoint”)
saver = saver_lib.Saver(write_version=saver_pb2.SaverDef.V2)
checkpoint_path = saver.save(sess, checkpoint_prefix, global_step=0,
latest_filename=‘checkpoint_state’)
graph_io.write_graph(sess.graph, ‘.’, ‘tmp.pb’)
freeze_graph.freeze_graph(‘./tmp.pb’, ‘’,
False, checkpoint_path, “output_node0”,
“save/restore_all”, “save/Const:0”,
‘frozen_graph.pb’, False, “”)
output_names=[‘reshape_1/Reshape’]
uff_model = uff.from_tensorflow_frozen_model(“frozen_graph.pb”, output_names, output_filename = “model.uff”)
Then I try to create the tensorRT engine with the following code:
parser = uffparser.create_uff_parser()
parser.register_input(“input_1”, (3, 416, 416), 0)
parser.register_output(“reshape_1/Reshape”)
engine = trt.utils.uff_file_to_trt_engine(G_LOGGER, uff_file, parser, 1, 1 << 20, trt.infer.DataType.FLOAT)
I get the error message:
[TensorRT] ERROR: Parameter check failed at: Network.cpp::addConcatenation::152, condition: first->getDimensions().d[j] == dims.d[j] && “All non-channel dimensions must match across tensors.”
Segmentation fault (core dumped)
I tried to comment out the concatenate layer and then the engine was created as it should. Could you please take a look at the code and see if I freeze the model the wrong way somehow?
Thanks!