Error in Converting the h5 model to the UFF model (TensorRT\samples\opensource\sampleUffMaskRCNN\converted)

Hi,I followed the github(https://github.com/NVIDIA/TensorRT/blob/release/6.0/samples/opensource/sampleUffMaskRCNN/README.md) instructions to convert the h5 model to the UFF model。but an error occured while converting. do you no why?

Traceback (most recent call last):
File “mrcnn_to_trt_single.py”, line 164, in
main()
File “mrcnn_to_trt_single.py”, line 123, in main
text=True, list_nodes=list_nodes)
File “mrcnn_to_trt_single.py”, line 157, in convert_model
debug_mode = False
File “/home/linyong/.conda/envs/maskRcnn_train/lib/python3.7/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 229, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
File “/home/linyong/.conda/envs/maskRcnn_train/lib/python3.7/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 178, in from_tensorflow
debug_mode=debug_mode)
File “/home/linyong/.conda/envs/maskRcnn_train/lib/python3.7/site-packages/uff/converters/tensorflow/converter.py”, line 94, in convert_tf2uff_graph
uff_graph, input_replacements, debug_mode=debug_mode)
File “/home/linyong/.conda/envs/maskRcnn_train/lib/python3.7/site-packages/uff/converters/tensorflow/converter.py”, line 79, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
File “/home/linyong/.conda/envs/maskRcnn_train/lib/python3.7/site-packages/uff/converters/tensorflow/converter.py”, line 47, in convert_layer
return cls.registry_[op](name, tf_node, inputs, uff_graph, **kwargs)
File “/home/linyong/.conda/envs/maskRcnn_train/lib/python3.7/site-packages/uff/converters/tensorflow/converter_functions.py”, line 307, in convert_transpose
tf_permutation_node = kwargs[“tf_nodes”][inputs[1]]
IndexError: list index out of range

anybody here?

Hi,I have the same problem with you,have you solved the problem yet?If you have solved,could you please tell how to solve it? Thanks.

Same problem here.
When I run this command.

python3 mrcnn_to_trt_single.py -w ../../../data/mask_rcnn_coco.h5 -o ../../../data/mrcnn_nchw.uff -p ./config.py

Then I got this error message.

Converting to UFF graph
Traceback (most recent call last):
  File "mrcnn_to_trt_single.py", line 164, in <module>
    main()
  File "mrcnn_to_trt_single.py", line 123, in main
    text=True, list_nodes=list_nodes)
  File "mrcnn_to_trt_single.py", line 157, in convert_model
    debug_mode = False
  File "/home/chieh/.local/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 229, in from_tensorflow_frozen_model
    return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
  File "/home/chieh/.local/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py", line 178, in from_tensorflow
    debug_mode=debug_mode)
  File "/home/chieh/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 94, in convert_tf2uff_graph
    uff_graph, input_replacements, debug_mode=debug_mode)
  File "/home/chieh/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 79, in convert_tf2uff_node
    op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
  File "/home/chieh/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py", line 47, in convert_layer
    return cls.registry_[op](name, tf_node, inputs, uff_graph, **kwargs)
  File "/home/chieh/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter_functions.py", line 40, in convert_add
    uff_graph.binary(inputs[0], inputs[1], 'add', name)
IndexError: list index out of range

But in my case, I was trying the SampleMaskrcnn sample in the TensorRT version7 where was downloaded from NVIidia website.

I compared those readme.md, and the readme.md of you provided the link. It looks like very similar. Is there different? :)

BTW I already modified this part.

uff_graph.conv_transpose(
	    inputs[0], inputs[2], inputs[1],
	    strides, padding,
	    dilation=None, number_groups=number_groups,
	    left_format=lhs_fmt, right_format=rhs_fmt,
	    name=name, fields=fields
	    )
  • Ubuntu 18.04
  • TensorRT version 7
  • TensorFlow version 1.14
  • python version 3.6

I met with the same issue.

My environment:

  • Ubuntu 18.04 x86-4
  • TensorRT 7
  • Python 2.7

I executed the steps at TensorRT/README.md at release/7.0 · NVIDIA/TensorRT · GitHub on sample codes got from /usr/src/tensorrt/samples directly.

user@localhost:~/tensorrt-samples/sampleUffMaskRCNN/converted$ python mrcnn_to_trt_single.py -w /usr/src/tensorrt/data/faster-rcnn/mask_rcnn_coco.h5 -o /usr/src/tensorrt/data/faster-rcnn/mrcnn_nchw.uff -p config.py

output.log

Configurations:
BACKBONE resnet101
BACKBONE_STRIDES [4, 8, 16, 32, 64]
BATCH_SIZE 1
BBOX_STD_DEV [0.1 0.1 0.2 0.2]
COMPUTE_BACKBONE_SHAPE None
DETECTION_MAX_INSTANCES 100
DETECTION_MIN_CONFIDENCE 0.7
DETECTION_NMS_THRESHOLD 0.3
FPN_CLASSIF_FC_LAYERS_SIZE 1024
GPU_COUNT 1
GRADIENT_CLIP_NORM 5.0
IMAGES_PER_GPU 1
IMAGE_CHANNEL_COUNT 3
IMAGE_MAX_DIM 1024
IMAGE_META_SIZE 93
IMAGE_MIN_DIM 800
IMAGE_MIN_SCALE 0
IMAGE_RESIZE_MODE square
IMAGE_SHAPE [1024 1024 3]
LEARNING_MOMENTUM 0.9
LEARNING_RATE 0.001
LOSS_WEIGHTS {‘mrcnn_mask_loss’: 1.0, ‘rpn_bbox_loss’: 1.0, ‘mrcnn_bbox_loss’: 1.0, ‘mrcnn_class_loss’: 1.0, ‘rpn_class_loss’: 1.0}
MASK_POOL_SIZE 14
MASK_SHAPE [28, 28]
MAX_GT_INSTANCES 100
MEAN_PIXEL [123.7 116.8 103.9]
MINI_MASK_SHAPE (56, 56)
NAME coco
NUM_CLASSES 81
POOL_SIZE 7
POST_NMS_ROIS_INFERENCE 1000
POST_NMS_ROIS_TRAINING 2000
PRE_NMS_LIMIT 6000
ROI_POSITIVE_RATIO 0.33
RPN_ANCHOR_RATIOS [0.5, 1, 2]
RPN_ANCHOR_SCALES (32, 64, 128, 256, 512)
RPN_ANCHOR_STRIDE 1
RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD 0.7
RPN_TRAIN_ANCHORS_PER_IMAGE 256
STEPS_PER_EPOCH 1000
TOP_DOWN_PYRAMID_SIZE 256
TRAIN_BN False
TRAIN_ROIS_PER_IMAGE 200
USE_MINI_MASK True
USE_RPN_ROIS True
VALIDATION_STEPS 50
WEIGHT_DECAY 0.0001


Layer (type) Output Shape Param # Connected to

input_image (InputLayer) (None, 3, 1024, 1024 0


zero_padding2d_1 (ZeroPadding2D (None, 3, 1030, 1030 0 input_image[0][0]


conv1 (Conv2D) (None, 64, 512, 512) 9472 zero_padding2d_1[0][0]


bn_conv1 (BatchNorm) (None, 64, 512, 512) 256 conv1[0][0]


activation_1 (Activation) (None, 64, 512, 512) 0 bn_conv1[0][0]


max_pooling2d_1 (MaxPooling2D) (None, 64, 256, 256) 0 activation_1[0][0]


res2a_branch2a (Conv2D) (None, 64, 256, 256) 4160 max_pooling2d_1[0][0]


bn2a_branch2a (BatchNorm) (None, 64, 256, 256) 256 res2a_branch2a[0][0]


activation_2 (Activation) (None, 64, 256, 256) 0 bn2a_branch2a[0][0]


res2a_branch2b (Conv2D) (None, 64, 256, 256) 36928 activation_2[0][0]


bn2a_branch2b (BatchNorm) (None, 64, 256, 256) 256 res2a_branch2b[0][0]


activation_3 (Activation) (None, 64, 256, 256) 0 bn2a_branch2b[0][0]


res2a_branch2c (Conv2D) (None, 256, 256, 256 16640 activation_3[0][0]


res2a_branch1 (Conv2D) (None, 256, 256, 256 16640 max_pooling2d_1[0][0]


bn2a_branch2c (BatchNorm) (None, 256, 256, 256 1024 res2a_branch2c[0][0]


bn2a_branch1 (BatchNorm) (None, 256, 256, 256 1024 res2a_branch1[0][0]


add_1 (Add) (None, 256, 256, 256 0 bn2a_branch2c[0][0]
bn2a_branch1[0][0]


res2a_out (Activation) (None, 256, 256, 256 0 add_1[0][0]


res2b_branch2a (Conv2D) (None, 64, 256, 256) 16448 res2a_out[0][0]


bn2b_branch2a (BatchNorm) (None, 64, 256, 256) 256 res2b_branch2a[0][0]


activation_4 (Activation) (None, 64, 256, 256) 0 bn2b_branch2a[0][0]


res2b_branch2b (Conv2D) (None, 64, 256, 256) 36928 activation_4[0][0]


bn2b_branch2b (BatchNorm) (None, 64, 256, 256) 256 res2b_branch2b[0][0]


activation_5 (Activation) (None, 64, 256, 256) 0 bn2b_branch2b[0][0]


res2b_branch2c (Conv2D) (None, 256, 256, 256 16640 activation_5[0][0]


bn2b_branch2c (BatchNorm) (None, 256, 256, 256 1024 res2b_branch2c[0][0]


add_2 (Add) (None, 256, 256, 256 0 bn2b_branch2c[0][0]
res2a_out[0][0]


res2b_out (Activation) (None, 256, 256, 256 0 add_2[0][0]


res2c_branch2a (Conv2D) (None, 64, 256, 256) 16448 res2b_out[0][0]


bn2c_branch2a (BatchNorm) (None, 64, 256, 256) 256 res2c_branch2a[0][0]


activation_6 (Activation) (None, 64, 256, 256) 0 bn2c_branch2a[0][0]


res2c_branch2b (Conv2D) (None, 64, 256, 256) 36928 activation_6[0][0]


bn2c_branch2b (BatchNorm) (None, 64, 256, 256) 256 res2c_branch2b[0][0]


activation_7 (Activation) (None, 64, 256, 256) 0 bn2c_branch2b[0][0]


res2c_branch2c (Conv2D) (None, 256, 256, 256 16640 activation_7[0][0]


bn2c_branch2c (BatchNorm) (None, 256, 256, 256 1024 res2c_branch2c[0][0]


add_3 (Add) (None, 256, 256, 256 0 bn2c_branch2c[0][0]
res2b_out[0][0]


res2c_out (Activation) (None, 256, 256, 256 0 add_3[0][0]


res3a_branch2a (Conv2D) (None, 128, 128, 128 32896 res2c_out[0][0]


bn3a_branch2a (BatchNorm) (None, 128, 128, 128 512 res3a_branch2a[0][0]


activation_8 (Activation) (None, 128, 128, 128 0 bn3a_branch2a[0][0]


res3a_branch2b (Conv2D) (None, 128, 128, 128 147584 activation_8[0][0]


bn3a_branch2b (BatchNorm) (None, 128, 128, 128 512 res3a_branch2b[0][0]


activation_9 (Activation) (None, 128, 128, 128 0 bn3a_branch2b[0][0]


res3a_branch2c (Conv2D) (None, 512, 128, 128 66048 activation_9[0][0]


res3a_branch1 (Conv2D) (None, 512, 128, 128 131584 res2c_out[0][0]


bn3a_branch2c (BatchNorm) (None, 512, 128, 128 2048 res3a_branch2c[0][0]


bn3a_branch1 (BatchNorm) (None, 512, 128, 128 2048 res3a_branch1[0][0]


add_4 (Add) (None, 512, 128, 128 0 bn3a_branch2c[0][0]
bn3a_branch1[0][0]


res3a_out (Activation) (None, 512, 128, 128 0 add_4[0][0]


res3b_branch2a (Conv2D) (None, 128, 128, 128 65664 res3a_out[0][0]


bn3b_branch2a (BatchNorm) (None, 128, 128, 128 512 res3b_branch2a[0][0]


activation_10 (Activation) (None, 128, 128, 128 0 bn3b_branch2a[0][0]


res3b_branch2b (Conv2D) (None, 128, 128, 128 147584 activation_10[0][0]


bn3b_branch2b (BatchNorm) (None, 128, 128, 128 512 res3b_branch2b[0][0]


activation_11 (Activation) (None, 128, 128, 128 0 bn3b_branch2b[0][0]


res3b_branch2c (Conv2D) (None, 512, 128, 128 66048 activation_11[0][0]


bn3b_branch2c (BatchNorm) (None, 512, 128, 128 2048 res3b_branch2c[0][0]


add_5 (Add) (None, 512, 128, 128 0 bn3b_branch2c[0][0]
res3a_out[0][0]


res3b_out (Activation) (None, 512, 128, 128 0 add_5[0][0]


res3c_branch2a (Conv2D) (None, 128, 128, 128 65664 res3b_out[0][0]


bn3c_branch2a (BatchNorm) (None, 128, 128, 128 512 res3c_branch2a[0][0]


activation_12 (Activation) (None, 128, 128, 128 0 bn3c_branch2a[0][0]


res3c_branch2b (Conv2D) (None, 128, 128, 128 147584 activation_12[0][0]


bn3c_branch2b (BatchNorm) (None, 128, 128, 128 512 res3c_branch2b[0][0]


activation_13 (Activation) (None, 128, 128, 128 0 bn3c_branch2b[0][0]


res3c_branch2c (Conv2D) (None, 512, 128, 128 66048 activation_13[0][0]


bn3c_branch2c (BatchNorm) (None, 512, 128, 128 2048 res3c_branch2c[0][0]


add_6 (Add) (None, 512, 128, 128 0 bn3c_branch2c[0][0]
res3b_out[0][0]


res3c_out (Activation) (None, 512, 128, 128 0 add_6[0][0]


res3d_branch2a (Conv2D) (None, 128, 128, 128 65664 res3c_out[0][0]


bn3d_branch2a (BatchNorm) (None, 128, 128, 128 512 res3d_branch2a[0][0]


activation_14 (Activation) (None, 128, 128, 128 0 bn3d_branch2a[0][0]


res3d_branch2b (Conv2D) (None, 128, 128, 128 147584 activation_14[0][0]


bn3d_branch2b (BatchNorm) (None, 128, 128, 128 512 res3d_branch2b[0][0]


activation_15 (Activation) (None, 128, 128, 128 0 bn3d_branch2b[0][0]


res3d_branch2c (Conv2D) (None, 512, 128, 128 66048 activation_15[0][0]


bn3d_branch2c (BatchNorm) (None, 512, 128, 128 2048 res3d_branch2c[0][0]


add_7 (Add) (None, 512, 128, 128 0 bn3d_branch2c[0][0]
res3c_out[0][0]


res3d_out (Activation) (None, 512, 128, 128 0 add_7[0][0]


res4a_branch2a (Conv2D) (None, 256, 64, 64) 131328 res3d_out[0][0]


bn4a_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4a_branch2a[0][0]


activation_16 (Activation) (None, 256, 64, 64) 0 bn4a_branch2a[0][0]


res4a_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_16[0][0]


bn4a_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4a_branch2b[0][0]


activation_17 (Activation) (None, 256, 64, 64) 0 bn4a_branch2b[0][0]


res4a_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_17[0][0]


res4a_branch1 (Conv2D) (None, 1024, 64, 64) 525312 res3d_out[0][0]


bn4a_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4a_branch2c[0][0]


bn4a_branch1 (BatchNorm) (None, 1024, 64, 64) 4096 res4a_branch1[0][0]


add_8 (Add) (None, 1024, 64, 64) 0 bn4a_branch2c[0][0]
bn4a_branch1[0][0]


res4a_out (Activation) (None, 1024, 64, 64) 0 add_8[0][0]


res4b_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4a_out[0][0]


bn4b_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4b_branch2a[0][0]


activation_18 (Activation) (None, 256, 64, 64) 0 bn4b_branch2a[0][0]


res4b_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_18[0][0]


bn4b_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4b_branch2b[0][0]


activation_19 (Activation) (None, 256, 64, 64) 0 bn4b_branch2b[0][0]


res4b_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_19[0][0]


bn4b_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4b_branch2c[0][0]


add_9 (Add) (None, 1024, 64, 64) 0 bn4b_branch2c[0][0]
res4a_out[0][0]


res4b_out (Activation) (None, 1024, 64, 64) 0 add_9[0][0]


res4c_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4b_out[0][0]


bn4c_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4c_branch2a[0][0]


activation_20 (Activation) (None, 256, 64, 64) 0 bn4c_branch2a[0][0]


res4c_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_20[0][0]


bn4c_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4c_branch2b[0][0]


activation_21 (Activation) (None, 256, 64, 64) 0 bn4c_branch2b[0][0]


res4c_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_21[0][0]


bn4c_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4c_branch2c[0][0]


add_10 (Add) (None, 1024, 64, 64) 0 bn4c_branch2c[0][0]
res4b_out[0][0]


res4c_out (Activation) (None, 1024, 64, 64) 0 add_10[0][0]


res4d_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4c_out[0][0]


bn4d_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4d_branch2a[0][0]


activation_22 (Activation) (None, 256, 64, 64) 0 bn4d_branch2a[0][0]


res4d_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_22[0][0]


bn4d_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4d_branch2b[0][0]


activation_23 (Activation) (None, 256, 64, 64) 0 bn4d_branch2b[0][0]


res4d_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_23[0][0]


bn4d_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4d_branch2c[0][0]


add_11 (Add) (None, 1024, 64, 64) 0 bn4d_branch2c[0][0]
res4c_out[0][0]


res4d_out (Activation) (None, 1024, 64, 64) 0 add_11[0][0]


res4e_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4d_out[0][0]


bn4e_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4e_branch2a[0][0]


activation_24 (Activation) (None, 256, 64, 64) 0 bn4e_branch2a[0][0]


res4e_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_24[0][0]


bn4e_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4e_branch2b[0][0]


activation_25 (Activation) (None, 256, 64, 64) 0 bn4e_branch2b[0][0]


res4e_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_25[0][0]


bn4e_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4e_branch2c[0][0]


add_12 (Add) (None, 1024, 64, 64) 0 bn4e_branch2c[0][0]
res4d_out[0][0]


res4e_out (Activation) (None, 1024, 64, 64) 0 add_12[0][0]


res4f_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4e_out[0][0]


bn4f_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4f_branch2a[0][0]


activation_26 (Activation) (None, 256, 64, 64) 0 bn4f_branch2a[0][0]


res4f_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_26[0][0]


bn4f_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4f_branch2b[0][0]


activation_27 (Activation) (None, 256, 64, 64) 0 bn4f_branch2b[0][0]


res4f_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_27[0][0]


bn4f_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4f_branch2c[0][0]


add_13 (Add) (None, 1024, 64, 64) 0 bn4f_branch2c[0][0]
res4e_out[0][0]


res4f_out (Activation) (None, 1024, 64, 64) 0 add_13[0][0]


res4g_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4f_out[0][0]


bn4g_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4g_branch2a[0][0]


activation_28 (Activation) (None, 256, 64, 64) 0 bn4g_branch2a[0][0]


res4g_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_28[0][0]


bn4g_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4g_branch2b[0][0]


activation_29 (Activation) (None, 256, 64, 64) 0 bn4g_branch2b[0][0]


res4g_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_29[0][0]


bn4g_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4g_branch2c[0][0]


add_14 (Add) (None, 1024, 64, 64) 0 bn4g_branch2c[0][0]
res4f_out[0][0]


res4g_out (Activation) (None, 1024, 64, 64) 0 add_14[0][0]


res4h_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4g_out[0][0]


bn4h_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4h_branch2a[0][0]


activation_30 (Activation) (None, 256, 64, 64) 0 bn4h_branch2a[0][0]


res4h_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_30[0][0]


bn4h_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4h_branch2b[0][0]


activation_31 (Activation) (None, 256, 64, 64) 0 bn4h_branch2b[0][0]


res4h_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_31[0][0]


bn4h_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4h_branch2c[0][0]


add_15 (Add) (None, 1024, 64, 64) 0 bn4h_branch2c[0][0]
res4g_out[0][0]


res4h_out (Activation) (None, 1024, 64, 64) 0 add_15[0][0]


res4i_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4h_out[0][0]


bn4i_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4i_branch2a[0][0]


activation_32 (Activation) (None, 256, 64, 64) 0 bn4i_branch2a[0][0]


res4i_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_32[0][0]


bn4i_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4i_branch2b[0][0]


activation_33 (Activation) (None, 256, 64, 64) 0 bn4i_branch2b[0][0]


res4i_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_33[0][0]


bn4i_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4i_branch2c[0][0]


add_16 (Add) (None, 1024, 64, 64) 0 bn4i_branch2c[0][0]
res4h_out[0][0]


res4i_out (Activation) (None, 1024, 64, 64) 0 add_16[0][0]


res4j_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4i_out[0][0]


bn4j_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4j_branch2a[0][0]


activation_34 (Activation) (None, 256, 64, 64) 0 bn4j_branch2a[0][0]


res4j_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_34[0][0]


bn4j_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4j_branch2b[0][0]


activation_35 (Activation) (None, 256, 64, 64) 0 bn4j_branch2b[0][0]


res4j_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_35[0][0]


bn4j_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4j_branch2c[0][0]


add_17 (Add) (None, 1024, 64, 64) 0 bn4j_branch2c[0][0]
res4i_out[0][0]


res4j_out (Activation) (None, 1024, 64, 64) 0 add_17[0][0]


res4k_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4j_out[0][0]


bn4k_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4k_branch2a[0][0]


activation_36 (Activation) (None, 256, 64, 64) 0 bn4k_branch2a[0][0]


res4k_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_36[0][0]


bn4k_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4k_branch2b[0][0]


activation_37 (Activation) (None, 256, 64, 64) 0 bn4k_branch2b[0][0]


res4k_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_37[0][0]


bn4k_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4k_branch2c[0][0]


add_18 (Add) (None, 1024, 64, 64) 0 bn4k_branch2c[0][0]
res4j_out[0][0]


res4k_out (Activation) (None, 1024, 64, 64) 0 add_18[0][0]


res4l_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4k_out[0][0]


bn4l_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4l_branch2a[0][0]


activation_38 (Activation) (None, 256, 64, 64) 0 bn4l_branch2a[0][0]


res4l_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_38[0][0]


bn4l_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4l_branch2b[0][0]


activation_39 (Activation) (None, 256, 64, 64) 0 bn4l_branch2b[0][0]


res4l_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_39[0][0]


bn4l_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4l_branch2c[0][0]


add_19 (Add) (None, 1024, 64, 64) 0 bn4l_branch2c[0][0]
res4k_out[0][0]


res4l_out (Activation) (None, 1024, 64, 64) 0 add_19[0][0]


res4m_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4l_out[0][0]


bn4m_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4m_branch2a[0][0]


activation_40 (Activation) (None, 256, 64, 64) 0 bn4m_branch2a[0][0]


res4m_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_40[0][0]


bn4m_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4m_branch2b[0][0]


activation_41 (Activation) (None, 256, 64, 64) 0 bn4m_branch2b[0][0]


res4m_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_41[0][0]


bn4m_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4m_branch2c[0][0]


add_20 (Add) (None, 1024, 64, 64) 0 bn4m_branch2c[0][0]
res4l_out[0][0]


res4m_out (Activation) (None, 1024, 64, 64) 0 add_20[0][0]


res4n_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4m_out[0][0]


bn4n_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4n_branch2a[0][0]


activation_42 (Activation) (None, 256, 64, 64) 0 bn4n_branch2a[0][0]


res4n_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_42[0][0]


bn4n_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4n_branch2b[0][0]


activation_43 (Activation) (None, 256, 64, 64) 0 bn4n_branch2b[0][0]


res4n_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_43[0][0]


bn4n_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4n_branch2c[0][0]


add_21 (Add) (None, 1024, 64, 64) 0 bn4n_branch2c[0][0]
res4m_out[0][0]


res4n_out (Activation) (None, 1024, 64, 64) 0 add_21[0][0]


res4o_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4n_out[0][0]


bn4o_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4o_branch2a[0][0]


activation_44 (Activation) (None, 256, 64, 64) 0 bn4o_branch2a[0][0]


res4o_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_44[0][0]


bn4o_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4o_branch2b[0][0]


activation_45 (Activation) (None, 256, 64, 64) 0 bn4o_branch2b[0][0]


res4o_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_45[0][0]


bn4o_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4o_branch2c[0][0]


add_22 (Add) (None, 1024, 64, 64) 0 bn4o_branch2c[0][0]
res4n_out[0][0]


res4o_out (Activation) (None, 1024, 64, 64) 0 add_22[0][0]


res4p_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4o_out[0][0]


bn4p_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4p_branch2a[0][0]


activation_46 (Activation) (None, 256, 64, 64) 0 bn4p_branch2a[0][0]


res4p_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_46[0][0]


bn4p_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4p_branch2b[0][0]


activation_47 (Activation) (None, 256, 64, 64) 0 bn4p_branch2b[0][0]


res4p_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_47[0][0]


bn4p_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4p_branch2c[0][0]


add_23 (Add) (None, 1024, 64, 64) 0 bn4p_branch2c[0][0]
res4o_out[0][0]


res4p_out (Activation) (None, 1024, 64, 64) 0 add_23[0][0]


res4q_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4p_out[0][0]


bn4q_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4q_branch2a[0][0]


activation_48 (Activation) (None, 256, 64, 64) 0 bn4q_branch2a[0][0]


res4q_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_48[0][0]


bn4q_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4q_branch2b[0][0]


activation_49 (Activation) (None, 256, 64, 64) 0 bn4q_branch2b[0][0]


res4q_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_49[0][0]


bn4q_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4q_branch2c[0][0]


add_24 (Add) (None, 1024, 64, 64) 0 bn4q_branch2c[0][0]
res4p_out[0][0]


res4q_out (Activation) (None, 1024, 64, 64) 0 add_24[0][0]


res4r_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4q_out[0][0]


bn4r_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4r_branch2a[0][0]


activation_50 (Activation) (None, 256, 64, 64) 0 bn4r_branch2a[0][0]


res4r_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_50[0][0]


bn4r_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4r_branch2b[0][0]


activation_51 (Activation) (None, 256, 64, 64) 0 bn4r_branch2b[0][0]


res4r_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_51[0][0]


bn4r_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4r_branch2c[0][0]


add_25 (Add) (None, 1024, 64, 64) 0 bn4r_branch2c[0][0]
res4q_out[0][0]


res4r_out (Activation) (None, 1024, 64, 64) 0 add_25[0][0]


res4s_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4r_out[0][0]


bn4s_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4s_branch2a[0][0]


activation_52 (Activation) (None, 256, 64, 64) 0 bn4s_branch2a[0][0]


res4s_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_52[0][0]


bn4s_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4s_branch2b[0][0]


activation_53 (Activation) (None, 256, 64, 64) 0 bn4s_branch2b[0][0]


res4s_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_53[0][0]


bn4s_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4s_branch2c[0][0]


add_26 (Add) (None, 1024, 64, 64) 0 bn4s_branch2c[0][0]
res4r_out[0][0]


res4s_out (Activation) (None, 1024, 64, 64) 0 add_26[0][0]


res4t_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4s_out[0][0]


bn4t_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4t_branch2a[0][0]


activation_54 (Activation) (None, 256, 64, 64) 0 bn4t_branch2a[0][0]


res4t_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_54[0][0]


bn4t_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4t_branch2b[0][0]


activation_55 (Activation) (None, 256, 64, 64) 0 bn4t_branch2b[0][0]


res4t_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_55[0][0]


bn4t_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4t_branch2c[0][0]


add_27 (Add) (None, 1024, 64, 64) 0 bn4t_branch2c[0][0]
res4s_out[0][0]


res4t_out (Activation) (None, 1024, 64, 64) 0 add_27[0][0]


res4u_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4t_out[0][0]


bn4u_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4u_branch2a[0][0]


activation_56 (Activation) (None, 256, 64, 64) 0 bn4u_branch2a[0][0]


res4u_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_56[0][0]


bn4u_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4u_branch2b[0][0]


activation_57 (Activation) (None, 256, 64, 64) 0 bn4u_branch2b[0][0]


res4u_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_57[0][0]


bn4u_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4u_branch2c[0][0]


add_28 (Add) (None, 1024, 64, 64) 0 bn4u_branch2c[0][0]
res4t_out[0][0]


res4u_out (Activation) (None, 1024, 64, 64) 0 add_28[0][0]


res4v_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4u_out[0][0]


bn4v_branch2a (BatchNorm) (None, 256, 64, 64) 1024 res4v_branch2a[0][0]


activation_58 (Activation) (None, 256, 64, 64) 0 bn4v_branch2a[0][0]


res4v_branch2b (Conv2D) (None, 256, 64, 64) 590080 activation_58[0][0]


bn4v_branch2b (BatchNorm) (None, 256, 64, 64) 1024 res4v_branch2b[0][0]


activation_59 (Activation) (None, 256, 64, 64) 0 bn4v_branch2b[0][0]


res4v_branch2c (Conv2D) (None, 1024, 64, 64) 263168 activation_59[0][0]


bn4v_branch2c (BatchNorm) (None, 1024, 64, 64) 4096 res4v_branch2c[0][0]


add_29 (Add) (None, 1024, 64, 64) 0 bn4v_branch2c[0][0]
res4u_out[0][0]


res4v_out (Activation) (None, 1024, 64, 64) 0 add_29[0][0]


res4w_branch2a (Conv2D) (None, 256, 64, 64) 262400 res4v_out[0][0]


I’ve got the same issue in my Jetson Nano, and then in Linux PC. Here the version info for tools installed in my PC:

Ubuntu 18.04-3 LTS, amd64
TensorRT-7.0.0.11
CUDA 10.2.89
Keras 2.1.3
Tensorflow-gpu 1.15.2
Uff 0.6.5

Also, I must admit that the steps to convert TensorFlow model to UFF taken from

TensorRT-7.0.0.11/samples/sampleUffMaskRCNN/README.MD

look strange to me, as they require to patch model code, and then (even stranger!) UFF converter code.

Here is the log output from my PC:

python3 mrcnn_to_trt_single.py -w ~/Downloads/mask_rcnn_coco.h5 -o ~/Downloads/mrcnn_nchw.uff -p ./config.py
Using TensorFlow backend.
WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:146: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

Configurations:
BACKBONE resnet101
BACKBONE_STRIDES [4, 8, 16, 32, 64]
BATCH_SIZE 1
BBOX_STD_DEV [0.1 0.1 0.2 0.2]
COMPUTE_BACKBONE_SHAPE None
DETECTION_MAX_INSTANCES 100
DETECTION_MIN_CONFIDENCE 0.7
DETECTION_NMS_THRESHOLD 0.3
FPN_CLASSIF_FC_LAYERS_SIZE 1024
GPU_COUNT 1
GRADIENT_CLIP_NORM 5.0
IMAGES_PER_GPU 1
IMAGE_CHANNEL_COUNT 3
IMAGE_MAX_DIM 1024
IMAGE_META_SIZE 93
IMAGE_MIN_DIM 800
IMAGE_MIN_SCALE 0
IMAGE_RESIZE_MODE square
IMAGE_SHAPE [1024 1024 3]
LEARNING_MOMENTUM 0.9
LEARNING_RATE 0.001
LOSS_WEIGHTS {‘rpn_class_loss’: 1.0, ‘rpn_bbox_loss’: 1.0, ‘mrcnn_class_loss’: 1.0, ‘mrcnn_bbox_loss’: 1.0, ‘mrcnn_mask_loss’: 1.0}
MASK_POOL_SIZE 14
MASK_SHAPE [28, 28]
MAX_GT_INSTANCES 100
MEAN_PIXEL [123.7 116.8 103.9]
MINI_MASK_SHAPE (56, 56)
NAME coco
NUM_CLASSES 81
POOL_SIZE 7
POST_NMS_ROIS_INFERENCE 1000
POST_NMS_ROIS_TRAINING 2000
PRE_NMS_LIMIT 6000
ROI_POSITIVE_RATIO 0.33
RPN_ANCHOR_RATIOS [0.5, 1, 2]
RPN_ANCHOR_SCALES (32, 64, 128, 256, 512)
RPN_ANCHOR_STRIDE 1
RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD 0.7
RPN_TRAIN_ANCHORS_PER_IMAGE 256
STEPS_PER_EPOCH 1000
TOP_DOWN_PYRAMID_SIZE 256
TRAIN_BN False
TRAIN_ROIS_PER_IMAGE 200
USE_MINI_MASK True
USE_RPN_ROIS True
VALIDATION_STEPS 50
WEIGHT_DECAY 0.0001

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:504: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3828: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:166: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:171: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:176: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2020-01-27 17:27:39.920672: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-01-27 17:27:39.942966: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3393240000 Hz
2020-01-27 17:27:39.943747: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4dbe780 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-01-27 17:27:39.943786: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-01-27 17:27:39.946070: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-01-27 17:27:39.994490: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-01-27 17:27:39.994822: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4d49050 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-01-27 17:27:39.994849: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GT 710, Compute Capability 3.5
2020-01-27 17:27:39.995071: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-01-27 17:27:39.995452: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1639] Found device 0 with properties:
name: GeForce GT 710 major: 3 minor: 5 memoryClockRate(GHz): 0.954
pciBusID: 0000:0a:00.0
2020-01-27 17:27:39.995579: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libcudart.so.10.0’; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory
2020-01-27 17:27:39.995657: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libcublas.so.10.0’; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory
2020-01-27 17:27:39.995729: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libcufft.so.10.0’; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory
2020-01-27 17:27:39.995790: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libcurand.so.10.0’; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory
2020-01-27 17:27:39.995852: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libcusolver.so.10.0’; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory
2020-01-27 17:27:39.995914: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libcusparse.so.10.0’; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory
2020-01-27 17:27:40.000365: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-01-27 17:27:40.000399: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1662] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at 使用 pip 安装 TensorFlow for how to download and setup the required libraries for your platform.
Skipping registering GPU devices…
2020-01-27 17:27:40.000426: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1180] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-01-27 17:27:40.000439: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1186] 0
2020-01-27 17:27:40.000451: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1199] 0: N
WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:180: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:189: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:196: The name tf.variables_initializer is deprecated. Please use tf.compat.v1.variables_initializer instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3652: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:1928: The name tf.image.resize_nearest_neighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead.

WARNING:tensorflow:From /home/snilga/Mask_RCNN/mrcnn/model.py:341: The name tf.log is deprecated. Please use tf.math.log instead.

WARNING:tensorflow:From /home/snilga/Mask_RCNN/mrcnn/model.py:412: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
WARNING:tensorflow:From /home/snilga/Mask_RCNN/mrcnn/model.py:374: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version.
Instructions for updating:
box_ind is deprecated, use box_indices instead
WARNING:tensorflow:From /home/snilga/Mask_RCNN/mrcnn/model.py:731: The name tf.sets.set_intersection is deprecated. Please use tf.sets.intersection instead.

WARNING:tensorflow:From /home/snilga/Mask_RCNN/mrcnn/model.py:733: The name tf.sparse_tensor_to_dense is deprecated. Please use tf.sparse.to_dense instead.

WARNING:tensorflow:From /home/snilga/Mask_RCNN/mrcnn/model.py:783: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.


Layer (type) Output Shape Param # Connected to

input_image (InputLayer) (None, 3, 1024, 1024 0


zero_padding2d_1 (ZeroPadding2D (None, 3, 1030, 1030 0 input_image[0][0]


. . .
. . . Here was the log output for rest intermediate nodes
. . .


mrcnn_mask (TimeDistributed) (None, 100, 81, 28, 20817 mrcnn_mask_deconv[0][0]

Total params: 64,158,584
Trainable params: 64,047,096
Non-trainable params: 111,488


The output names of tensorflow graph nodes: [‘mrcnn_mask/Reshape_2’]
WARNING:tensorflow:From mrcnn_to_trt_single.py:137: convert_variables_to_constants (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.compat.v1.graph_util.convert_variables_to_constants
WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/tensorflow/python/framework/graph_util_impl.py:270: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.compat.v1.graph_util.extract_sub_graph
WARNING:tensorflow:From /home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py:227: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

UFF Version 0.6.5
=== Automatically deduced input nodes ===
[name: “input_image”
op: “Placeholder”
attr {
key: “dtype”
value {
type: DT_FLOAT
}
}
attr {
key: “shape”
value {
shape {
dim {
size: -1
}
dim {
size: 3
}
dim {
size: 1024
}
dim {
size: 1024
}
}
}
}
]

Using output node mrcnn_detection
Using output node mrcnn_mask/Sigmoid
Converting to UFF graph
Traceback (most recent call last):
File “mrcnn_to_trt_single.py”, line 164, in
main()
File “mrcnn_to_trt_single.py”, line 123, in main
text=True, list_nodes=list_nodes)
File “mrcnn_to_trt_single.py”, line 157, in convert_model
debug_mode = False
File “/home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 229, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
File “/home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 178, in from_tensorflow
debug_mode=debug_mode)
File “/home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 94, in convert_tf2uff_graph
uff_graph, input_replacements, debug_mode=debug_mode)
File “/home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 79, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes, debug_mode=debug_mode)
File “/home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter.py”, line 47, in convert_layer
return cls.registry_[op](name, tf_node, inputs, uff_graph, **kwargs)
File “/home/snilga/.local/lib/python3.6/site-packages/uff/converters/tensorflow/converter_functions.py”, line 40, in convert_add
uff_graph.binary(inputs[0], inputs[1], ‘add’, name)
IndexError: list index out of range

After short investigation I found that the conversion crashes in attempt to convert frozen graph (temp.pb) to UFF in file uff/converters/tensorflow/converter_function.py, line 40:

38: @tf2uff.register([“Add”])
39: def convert_add(name, tf_node, inputs, uff_graph, **kwargs):
40: uff_graph.binary(inputs[0], inputs[1], ‘add’, name)
41: return [tf2uff.split_node_name_and_output(inp)[0] for inp in inputs]

Here are values of variables passed to convert_add:

name = {str} ‘mrcnn_mask/add’

tf_node = {NodeDef} name: “mrcnn_mask/add”\nop: “Add”\ninput: “mrcnn_mask/transpose_1”\nattr {\n key: “T”\n value {\n type: DT_FLOAT\n }\n}\n

uff_graph = {Graph} <uff.model.graph.Graph object at 0x7ff47c2bda20>uff_graph = {Graph} <uff.model.graph.Graph object at 0x7ff47c2bda20>

exception = {tuple: 3} (<class ‘IndexError’>, IndexError(‘list index out of range’,), <traceback object at 0x7ff47c770e88>)

inputs = {list: 1} [‘mrcnn_mask/transpose_1’]

kwargs = {dict: 1} {‘tf_nodes’: {‘input_image’: name: “input_image”\nop: “Placeholder”\nattr {\n key: “dtype”\n value {\n type: DT_FLOAT\n }\n}\nattr {\n key: “shape”\n value {\n shape {\n dim {\n size: -1\n }\n dim {\n size: 3\n }\n dim {\n size: 1024\n }\n dim {\n size: 1024\n }\n }\n }\n}\n, ‘zero_padding2d_1/Pad/paddings’: name: “zero_padding2d_1/Pad/paddings”\nop: “Const”\nattr {\n key: “dtype”\n value {\n type: DT_INT32\n }\n}\nattr {\n key: “value”\n value {\n tensor {\n dtype: DT_INT32\n tensor_shape {\n dim {\n size: 4\n }\n dim {\n size: 2\n }\n }\n tensor_content: “\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\003\000\000\000\003\000\000\000\003\000\000\000”\n }\n }\n}\n, ‘zero_padding2d_1/Pad’: name: “zero_padding2d_1/Pad”\nop: “Pad”\ninput: “input_image”\ninput: “zero_padding2d_1/Pad/paddings”\nattr {\n key: “T”\n value {\n type: DT_FLOAT\n }\n}\nattr…

I’ve figured out that the example works well in Windows 10 (TensorRT 7.0.0.11 + CUDA 10.0 + tensorflow-gpu==1.14.0). I’m going to run it in NVIDIA Docker container TensorRT | NVIDIA NGC to see how far is NVIDIA’s marketing ahead of their development

i met the same problem. have you tried the docker container?

Yep. I tried about 5 most recent containers, with no success. Also, I figured out that despite I managed converting the model in Windows 10 host, the inference failed with some internal runtime exception

Note, I managed to convert Faster RCNN example in the most recent tensorrt:20.07-py3 Docker container, and even ran the inference in Jetson Nano board (needed to extend GPU RAM from 2GB to 3GB in the board though, which was easy, as GPU shares RAM with CPU). I didn’t like the inference results though: the pre-trained model works with quite small images, and did not detect even some obvious objects in the provided test images. I wonder if it might have degraded during conversion, or the accuracy is a way bad in float16 mode, which is the only supported mode by Jetson Nano

so there is no way to run mask rcnn example now ?

At least I din’t manage to convert and run it, or confirm that someone did. This is sad… Note, I filed a ticket to solve this, Model conversion from h5 to UFF in samples/sampleUffMaskRCNN/converted causes an "IndexError: list index out of range" exception · Issue #360 · NVIDIA/TensorRT · GitHub, it is still in TODO though

It still works if you use TensorRT 6. I built it in the nvcr.io/nvidia/tensorflow:19.10-py3 container.

My setup

  1. g4dn.xlarge instance on AWS
  2. NVIDIA Deep Learning AMI v20.08.1-46a68101-e56b-41cd-8e32-631ac6e5d02b-ami-0449a6ab6d0816650.4
  3. checked out and started nvcr.io/nvidia/tensorflow:19.10-py3 image
  4. Checked out GitHub - NVIDIA/TensorRT at release/6.0 into the running container
  5. Downloaded an untamed TensorRT-6.0.1.5.Ubuntu-18.04.x86_64-gnu.cuda-10.1.cudnn7.6 in my container
  6. Installed cmake 3.18 (from tar) in my container
  7. Followed instructions on TensorRT README.md to build TensorRT 6
  8. Then following instructions in sampleUffMaskRCNN succeeded in building the uff.

Hope that helps.

Hi @relativequanta1 you see to be the only person to have cracked it. Would you kindly share some more info on it ?

Can you elaborate this step ? I visit the TensorRT repo and there are 2 main subsections:

  1. Downloading TensorRT build

  2. Setting up the build environment

  3. Building TensorRT build-OSS

Do you follow each step as it is ?

Also, in the below section, I do not get how do you download “untamed TensorRT-6.0.1.5.Ubu…”

Hi,
Please refer to the installation steps from the below link if in case you are missing on anything

However suggested approach is to use TRT NGC containers to avoid any system dependency related issues.

In order to run python sample, make sure TRT python packages are installed while using NGC container.
/opt/tensorrt/python/python_setup.sh
Thanks!

Thanks for the suggestion @NVES . I am pulling the tensorRt container but found that issues like this recommend pulling container for tensorflow (nvcr.io/nvidia/tensorflow:18.12-py3). This leads to confusion.

Do I need to use both containers (for both tensorflow and tensorRT) ?

Can I have a more tried and tested explanation ?