Hello,
I am trying to create an engine from frozen tensorflow graph with the following code:
uff_model = uff.from_tensorflow_frozen_model("models/graph.pb", output_layers, output_filename="graph.uff")
parser = uffparser.create_uff_parser()
parser.register_input(input_layers, (1, 416, 416), 0)
parser.register_output(output_layers)
engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 20)
But it keeps giving error in the engine generation part. The output of the console is following:
Using output node detector/yolo-v3/Reshape
Using output node detector/yolo-v3/Reshape_5
Using output node detector/yolo-v3/Reshape_10
Converting to UFF graph
Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting as custom op ResizeNearestNeighbor detector/yolo-v3/ResizeNearestNeighbor_1
name: "detector/yolo-v3/ResizeNearestNeighbor_1"
op: "ResizeNearestNeighbor"
input: "detector/yolo-v3/transpose_4"
input: "detector/yolo-v3/ResizeNearestNeighbor_1/size"
attr {
key: "T"
value {
type: DT_FLOAT
}
}
attr {
key: "align_corners"
value {
b: false
}
}
Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting as custom op ResizeNearestNeighbor detector/yolo-v3/ResizeNearestNeighbor
name: "detector/yolo-v3/ResizeNearestNeighbor"
op: "ResizeNearestNeighbor"
input: "detector/yolo-v3/transpose_1"
input: "detector/yolo-v3/ResizeNearestNeighbor/size"
attr {
key: "T"
value {
type: DT_FLOAT
}
}
attr {
key: "align_corners"
value {
b: false
}
}
No. nodes: 778
UFF Output written to masa2.uff
/usr/lib/python2.7/dist-packages/tensorrt/utils/_utils.py:237: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
if datatype == infer.DataType.HALF and not builder.platform_has_fast_fp16():
Traceback (most recent call last):
File "/home/user/PycharmProjects/TensorOptimize/optimize_yolo.py", line 54, in <module>
generate_engine(output_layers=["detector/yolo-v3/Reshape", "detector/yolo-v3/Reshape_5", "detector/yolo-v3/Reshape_10"], input_layers=["Placeholder"])
File "/home/user/PycharmProjects/TensorOptimize/optimize_yolo.py", line 31, in generate_engine
engine = trt.utils.uff_to_trt_engine(G_LOGGER, uff_model, parser, 1, 1 << 20,datatype=trt.infer.DataType.HALF)
File "/usr/lib/python2.7/dist-packages/tensorrt/utils/_utils.py", line 237, in uff_to_trt_engine
if datatype == infer.DataType.HALF and not builder.platform_has_fast_fp16():
TypeError: Failed to decode Unicode string
Is there anybody with a solution to this ? Thanks