Hello! Our static bug checker has found a performance issue in models-master/research/object_detection/model_lib_v2.py: eager_eval_loop is repeatedly called in a for loop, but there is a tf.function decorated function compute_eval_dict defined and called in eager_eval_loop.
In that case, when eager_eval_loop is called in a loop, the function compute_eval_dict will create a new graph every time, and that can trigger tf.function retracing warning.
We are investigating this kind of issues, and your answer will be of great help to our work. Can you take a look? Thank you in advance! @AhmetFurkanDEMIR
Hello! Our static bug checker has found a performance issue in models-master/research/object_detection/model_lib_v2.py:
eager_eval_loop
is repeatedly called in a for loop, but there is a tf.function decorated functioncompute_eval_dict
defined and called ineager_eval_loop
.In that case, when
eager_eval_loop
is called in a loop, the functioncompute_eval_dict
will create a new graph every time, and that can trigger tf.function retracing warning.Here is the tensorflow document to support it.
Briefly, for better efficiency, it's better to use:
than:
Looking forward to your reply.