TensorRT 4の続き、
というのがあります。
tensorFlowのグラフをFreeze後、TensorRT用に最適化したグラフを生成して、TensorFlowで推論するんだね。。。
この中でFreeze後のグラフからTensorRT用に最適化したグラフを生成する関数が以下のような感じ
引用 trt_graph = trt.create_inference_graph( input_graph_def=frozen_graph_def, outputs=output_node_name, max_batch_size=batch_size, max_workspace_size_bytes=workspace_size, precision_mode=precision)
TensorRT 4では、
引用 Our next step is to enable use of TensorRT 4 with the latest version of TensorFlow. The latest integrated version can always be found in the NVIDIA GPU Cloud (NGC) TensorFlow container.
ということで、最新のTensorFlowに対応。現時点の最新版は、r1.9。。。なんだけどね。