Vengineerの妄想(準備期間)

人生は短いけど、長いです。人生を楽しみましょう!

TensorFlow – TensorRT Integration


TensorRT 4の続き、


TensorFlow – TensorRT Integration


というのがあります。

下記の図は、上記の記事からの引用です。
https://devblogs.nvidia.com/wp-content/uploads/2018/06/TensorRT4_Graphics-modified-workflow-1-625x357.png

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)

で、create_inference_graph を Google君に聞いたら。。。。
ああああ、自分のブログにTensorFlow r1.7にて、TensorRT統合、3月に書いていたわ。

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。。。なんだけどね。