tensorrt
tensorrt copied to clipboard
int8 precision tf model converting to tftrt
image_tensor = graph.get_tensor_by_name('wpf:0') calib_graph = trt.create_inference_graph( input_graph_def=graph_def, outputs=output_names, max_batch_size=1, minimum_segment_size=4, is_dynamic_op=True, maximum_cached_engines=3, max_workspace_size_bytes=trt.DEFAULT_TRT_MAX_WORKSPACE_SIZE_BYTES, precision_mode='INT8' )
a,b,c,d = tf.import_graph_def(calib_graph, input_map={"wpf": image_tensor},
return_elements=output_names, name="")
a, b, c, d = sess.run([a,b,c,d], feed_dict={image_tensor: [cv2.resize(cv2.imread("../images/1.jpg"),(608,600))]})
trt_graph = trt.calib_graph_to_infer_graph(calib_graph)
2020-10-12 06:59:42.707103: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] function_optimizer failed: Invalid argument: Invalid loop structure: Loop "BatchMultiClassNonMaxSuppression/map/while/while_context" has more than one LoopCond node: {{node BatchMultiClassNonMaxSuppression/map/while/LoopCond_1}} and {{node BatchMultiClassNonMaxSuppression/map/while/LoopCond}}. This is an internal bug, please file a bug report with instructions on how to reproduce the error. 2020-10-12 06:59:43.493964: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:586] function_optimizer failed: Invalid argument: Invalid loop structure: Loop "BatchMultiClassNonMaxSuppression/map/while/while_context" has more than one LoopCond node: {{node BatchMultiClassNonMaxSuppression/map/while/LoopCond}} and {{node BatchMultiClassNonMaxSuppression/map/while/LoopCond_1}}. This is an internal bug, please file a bug report with instructions on how to reproduce the error. Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call return fn(*args) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn target_list, run_metadata) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid loop structure: Loop "BatchMultiClassNonMaxSuppression/map/while/while_context" has more than one LoopCond node: {{node BatchMultiClassNonMaxSuppression/map/while/LoopCond}} and {{node BatchMultiClassNonMaxSuppression/map/while/LoopCond_1}}. This is an internal bug, please file a bug report with instructions on how to reproduce the error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/inspur/wpf/objec_dec_opt/dianwu_loulan/models/graph_info.py", line 440, in