-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
solution is described here
tensorflow/tensorflow#67033
with this kind of warning
WARNING:tensorflow:5 out of the last 5 calls to <function TensorFlowTrainer.make_train_function.<locals>.one_step_on_iterator at 0x796ef9fc58a0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to
(1) creating @tf.function repeatedly in a loop,
(2) passing tensors with different shapes,
(3) passing Python objects instead of tensors.
For (1), please define your @tf.function outside of the loop.
For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing.
For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
Metadata
Metadata
Assignees
Labels
No labels