Unable to convert tensorflow models master maskRcnn graph to tensorRT

Description

i am trying to use tensorRT version 5.0.2 in ngc container TensorRT:19.02-py2 to execute a pretrained tensorflow/models/research/maskRcnn network in TensorRT.

i have successfully converted the frozen graph to uff format using the following command :
convert_to_uff.py -o MyUffGraph --text FrozenModelFilename

when i parse the model using the following python code :
import tensorrt as trt
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
with trt.Builder(TRT_LOGGER) as builder, builder.create_network() as network, trt.UffParser() as parser:
parser.register_input(“image_tensor:0”, (3, 28, 28))
parser.register_output(“detection_boxes:0”)
parser.parse(“FfrMaskRcnnUffGraph.uff”, network)

i get the following error :
UFFParser: Graph error: Cycle graph detected

i have then retried the uff conversion , by adding the --debug flag.
i see that the output nodes have not been deduced correctly,
they are :
BatchMultiClassNonMaxSuppression_1/map/TensorArrayStack_1/TensorArrayGatherV3
BatchMultiClassNonMaxSuppression_1/map/TensorArrayStack_1/TensorArrayGatherV3
.
.
.
and not the expected detection_scores,detection_boxes,detection_masks…

i have tried to explicitly add the expected tensors using the -o flag,
this leads to errors like :
uff.model.exceptions.UffException: detection_boxes was not found in the graph
(and in the generated uffgraph.pbtxt file , i don’t see them)

i have found TF object detection faster rcnn nodes not found
which suggests that i am not the first person to encounter this problem, and that the issue is significantly more complicated then documented.

please advise,
Omer.

Hi @omerbrandis,
We recommend you to use the latest TRT release for improved performance.

Also UFF parser have been deprecated from TRT 7 onwards, hence suggest you to use ONNX parser.

Thanks!

hello

I can’t use the latest TRT release.
I need to use trt v 5.0.2. , to the best of my knowledge, its still supported .
v 5.0.2 still works with uff for tensorflow graphs.

thanks,
Omer.

moreover,
the documentation for trt v7.2.2 still states that the method for using tensorflow models in trt is uff

Hi @omerbrandis,
UFF and Caffe parser support have been deprecated from TRT 7 onwards, hence recommended approach is ONNX parser.
Quoting Deprecated Features from the below link.

Thanks!

Dear support,

It seems we are going around in circles.
I am using TRT version 5.0.2. which is supported, and according to the documentation available on line FOR THAT VERSION the recommended method to perform the import from tensorflow is UFF.

btw - i have also tried the onnx method, which does not work , i’ll open a different thread for that in a minute.

thanks,
Omer.

Hi @omerbrandis,
Please refer to the below post link

Thanks!