TensorRT uff parser fail to create the engine

When I use trt.utils.uff_to_trt_engine to create tensorRT engine(Python 2.7), it showed the following error.

So what is “infer.DataType_kHALF”?

However, if I use another script to read saved “model.uff” file, trt.utils.uff_to_trt_engine can create the engine without this error. May I know what problem could it be? Thanks.

TypeError Traceback (most recent call last)
in ()
723
724 if name == “main”:
→ 725 train()
726 #depoly()

in train()
622 parser.register_input(“input_image”, [1, 400, 400], 0)
623 parser.register_output(output_layer_names)
→ 624 engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 30)
625 parser.destroy()
626 trt.utils.write_engine_to_file(“./tf_model.engine”, engine.serialize())

/usr/local/lib/python2.7/dist-packages/tensorrt/utils/_utils.pyc in uff_to_trt_engine(logger, stream, parser, max_batch_size, max_workspace_size, datatype, plugin_factory, calibrator)
201 builder.set_max_workspace_size(max_workspace_size)
202
→ 203 if datatype == infer.DataType_kHALF:
204 builder.set_half2_mode(True)
205

TypeError: Failed to decode Unicode string

This problem is solved. There is a detail part, that uff.from_tensorflow() has a “**.uff” output, the return value would be “None”, so that is the reason make that error.

Hi, I have the same problem, but I don’t know how to solve it. Could you please specify your solution?

Thanks.