You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Possible tensorflow performance bottleneck due to repeated tracing of tf.function decorated modules
To Reproduce
In Simulated_Calibration.ipynb:
C3:STATUS:Savingas: /tmp/tmpaz0djjuu/c3logs/ORBIT_cal/2021_03_16_T_16_57_04/calibration.log
(5_w,10)-aCMA-ES (mu_w=3.2,w_1=45%) indimension4 (seed=1004483, TueMar1616:57:042021)
C3:STATUS:AddinginitialpointtoCMAsample.
WARNING:tensorflow:5outofthelast14callsto<functiontf_matmul_leftat0x7f97602a8dd0>triggeredtf.functionretracing. Tracingisexpensiveandtheexcessivenumberoftracingscouldbedueto (1) creating @tf.functionrepeatedlyinaloop, (2) passingtensorswithdifferentshapes, (3) passingPythonobjectsinsteadoftensors. For (1), pleasedefineyour @tf.functionoutsideoftheloop. For (2), @tf.functionhasexperimental_relax_shapes=Trueoptionthatrelaxesargumentshapesthatcanavoidunnecessaryretracing. For (3), pleaserefertohttps://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
Suggested workarounds
Possible causes and solutions:
(1) creating @tf.function repeatedly in a loop, -- please define your @tf.function outside of the loop.
(2) passing tensors with different shapes, -- @tf.function has experimental_relax_shapes=True option that relaxes argument shapes that can avoid unnecessary retracing.
(3) passing Python objects instead of tensors. -- please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
The text was updated successfully, but these errors were encountered:
Describe the bug
Possible tensorflow performance bottleneck due to repeated tracing of
tf.function
decorated modulesTo Reproduce
In
Simulated_Calibration.ipynb
:Suggested workarounds
Possible causes and solutions:
(1) creating @tf.function repeatedly in a loop, -- please define your @tf.function outside of the loop.
(2) passing tensors with different shapes, -- @tf.function has experimental_relax_shapes=True option that relaxes argument shapes that can avoid unnecessary retracing.
(3) passing Python objects instead of tensors. -- please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
The text was updated successfully, but these errors were encountered: