I use tensorrt to accelerate my object detection code, but it report error as follows

I have some self-define tensorflow operator, such as GPU_NMS, soft-nms, roi_align, etc. I suspect the problem is that graph convert process can’t deal with self-define operator?
report error :
2018-04-24 18:41:13.508884: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-04-24 18:41:13.508913: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:1 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 23 nodes)
2018-04-24 18:41:13.510451: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:2 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ExpandDims” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.512027: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:3 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_1” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.513630: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:4 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_60” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.515232: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:5 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_6” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.516776: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:6 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_6” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.518406: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:7 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones_2” SKIPPING…( 4 nodes)
2018-04-24 18:41:13.519999: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-04-24 18:41:13.520027: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:8 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 33 nodes)
2018-04-24 18:41:13.521587: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:9 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones_1” SKIPPING…( 3 nodes)
2018-04-24 18:41:13.523129: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:10 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_6/bbox_fc/MatMul” SKIPPING…( 4 nodes)
2018-04-24 18:41:13.524705: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:11 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_7” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.526373: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:12 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones_3” SKIPPING…( 4 nodes)
2018-04-24 18:41:13.528243: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-04-24 18:41:13.528296: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:13 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 380 nodes)
2018-04-24 18:41:13.530037: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:14 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_8” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.531584: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:15 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_89” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.533209: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:16 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones” SKIPPING…( 4 nodes)
2018-04-24 18:41:13.534757: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:17 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_5” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.536330: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:18 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_4” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.537874: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:19 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_62” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.539448: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:20 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_3” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.541017: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:21 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_6/ps_fc_1/MatMul” SKIPPING…( 3 nodes)
2018-04-24 18:41:13.542590: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:22 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_33” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.544159: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:23 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_2” SKIPPING…( 9 nodes)
2018-04-24 18:41:13.545757: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:24 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_35” SKIPPING…( 6 nodes)
2018-04-24 18:41:13.547447: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:25 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_87” SKIPPING…( 6 nodes)
2018-04-24 18:41:14.030285: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with pr

We created a new “Deep Learning Training and Inference” section in Devtalk to improve the experience for deep learning and accelerated computing, and HPC users:
https://devtalk.nvidia.com/default/board/301/deep-learning-training-and-inference-/

We are moving active deep learning threads to the new section.

URLs for topics will not change with the re-categorization. So your bookmarks and links will continue to work as earlier.

-Siddharth

Please file a bug here: https://developer.nvidia.com/nvidia-developer-program
Please include the steps used to reproduce the problem along with the output of infer_device.

@mvillmow, more detailed .
with gfile.FastGFile(“model.pb”,‘rb’) as f:
print(“!!!read model.pb”)
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
trt_graph=graph_def
print(‘Convert_to_trt’)
trt_graph = trt.create_inference_graph(graph_def, OUTPUT_NAMES,
max_batch_size=cfg.test_batch_per_gpu,
max_workspace_size_bytes=5000000000,
precision_mode=“FP16”) # Get optimized graph
print(“convert over!!!”)
Its code report error:
2018-05-08 17:07:04.021162: I tensorflow/core/grappler/devices.cc:51] Number of eligible GPUs (core count >= 8): 1
2018-05-08 17:07:05.103621: I tensorflow/contrib/tensorrt/convert/convert_graph.cc:383] MULTIPLE tensorrt candidate conversion: 26
2018-05-08 17:07:05.327556: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-05-08 17:07:05.327611: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:0 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 30 nodes)
2018-05-08 17:07:05.329221: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-05-08 17:07:05.329250: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:1 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 23 nodes)
2018-05-08 17:07:05.330784: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:2 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_1” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.332321: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:3 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_6” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.333864: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:4 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_7” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.335423: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:5 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones_2” SKIPPING…( 4 nodes)
2018-05-08 17:07:05.336962: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:6 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/strided_slice_12” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.338700: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:7 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_5” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.340288: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-05-08 17:07:05.340315: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:8 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 33 nodes)
2018-05-08 17:07:05.341841: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:9 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_89” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.343406: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:10 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_3” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.344943: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:11 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_6” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.346509: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:12 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_87” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.348038: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:13 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones_1” SKIPPING…( 3 nodes)
2018-05-08 17:07:05.349595: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:14 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_6/bbox_fc/MatMul” SKIPPING…( 4 nodes)
2018-05-08 17:07:05.351128: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:15 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones_3” SKIPPING…( 4 nodes)
2018-05-08 17:07:05.352999: E tensorflow/contrib/tensorrt/log/trt_logger.cc:38] DefaultLogger Parameter check failed at: …/builder/Network.cpp::addInput::377, condition: isValidDims(dims)
2018-05-08 17:07:05.353053: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:16 due to: “Invalid argument: Failed to create Input layer” SKIPPING…( 380 nodes)
2018-05-08 17:07:05.354686: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:17 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_8” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.356247: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:18 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/ones” SKIPPING…( 4 nodes)
2018-05-08 17:07:05.357884: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:19 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_4” SKIPPING…( 9 nodes)
2018-05-08 17:07:05.359498: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:20 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_62” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.361058: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:21 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_60” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.362622: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:22 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_33” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.364158: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:23 due to: “Unimplemented: Require 4 dimensional input. Got 1 resnet_v1_50_5/strided_slice_35” SKIPPING…( 6 nodes)
2018-05-08 17:07:05.365748: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:24 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_6/ps_fc_1/MatMul” SKIPPING…( 3 nodes)
2018-05-08 17:07:05.367314: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:25 due to: “Unimplemented: Require 4 dimensional input. Got 2 resnet_v1_50_5/Exp_2” SKIPPING…( 9 nodes)
convert over!!!

I have the same problem, model input is 4D tensor with batch size=1 and channel=3.

I also met this problem on facenet.

2018-05-29 19:37:21.080278: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:407 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_2/Branch_2/Conv2d_0a_1x1/BatchNorm/cond/AssignMovingAvg/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.082556: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:408 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_2/Branch_0/Conv2d_1x1/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.084803: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:409 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_1/Branch_2/Conv2d_0c_3x3/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.087059: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:410 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_1/Branch_2/Conv2d_0c_3x3/BatchNorm/cond/AssignMovingAvg/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.089310: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:411 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_1/Branch_2/Conv2d_0a_1x1/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.091572: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:412 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat_1/block17_2/Branch_1/Conv2d_0c_7x1/BatchNorm/cond/Merge_1” SKIPPING…( 6 nodes)
2018-05-29 19:37:21.093823: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:413 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_1/Branch_1/Conv2d_0a_1x1/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.096078: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:414 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_1/Branch_0/Conv2d_1x1/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.098400: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:415 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Conv2d_4b_3x3/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.100653: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:416 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Conv2d_2b_3x3/BatchNorm/cond/AssignMovingAvg/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.102916: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:417 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat_1/block17_9/Branch_1/Conv2d_0c_7x1/BatchNorm/cond/AssignMovingAvg/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.105173: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:418 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat/block35_5/Branch_2/Conv2d_0a_1x1/BatchNorm/cond/AssignMovingAvg/sub/Switch” SKIPPING…( 4 nodes)
2018-05-29 19:37:21.107430: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:419 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Mixed_7a/Branch_2/Conv2d_0b_3x3/BatchNorm/cond/Merge_1” SKIPPING…( 6 nodes)
2018-05-29 19:37:21.109686: W tensorflow/contrib/tensorrt/convert/convert_graph.cc:418] subgraph conversion error for subgraph_index:420 due to: “Unimplemented: Require 4 dimensional input. Got 1 InceptionResnetV1/Repeat_1/block17_8/Branch_1/Conv2d_0b_1x7/BatchNorm/cond/AssignMovingAvg_1/sub/Switch” SKIPPING…( 4 nodes)

Any progress ?
Please give us some advices.

Thanks