Search code examples
tensorflowtensorrt

TensorRTOptimizer Warning


I got this warning everytime when I optimize a tensorflow graph:

TensorRTOptimizer is probably called on funcdef! This optimizer must *NOT* be called on function objects.

I just want to understand what this warning means, how can I avoid it and what its impact.

I am using tensorRT 5.1.5 with cuda 10.0 and tensorflow-gpu 1.15

Thanks!


Solution

  • It's safe to ignore this warning.

    The warning message has been improved a little bit in TF 2.1, but it's still there.

    Here is what happens in a nutshell:

    We name the input graph tf_graph and then call TF grappler on the input. Then grappler runs the TRT optimization pass on multiple objects that are available in the input (including tf_graph).

    TF-TRT checks internally what object is being used and only continues with the optimization if the object name is tf_graph and otherwise prints a warning message and returns.

    Dup post: https://devtalk.nvidia.com/default/topic/1069865/tensorrt/tensorrtoptimizer-warning-tensorrtoptimizer-is-probably-called-on-funcdef-this-optimizer-must-not-be-called-on-function-objects-/