hi, as the warning message says, you are decorating some code using tf.function that is leading parts of the computation getting traced multiple times (for example you are decorating the call of a layer, data transformation, etc). (its just a warning telling you that its not convenient to do that in terms of performance since tracing is expensive) , if you want to decorate functions with tf.function make sure you have it either outside of the loop or decorating an expensive operation (for example an update step function where tf.GradientTape is used).
one example of bad usage that happened to me when tf 2.0 came out: you have a custom layer where the call is decorated with tf.function… then the message will appear

  

      stackoverflow.com
  

  
      
    
  


  TensorFlow 2.0: do you need a @tf.function decorator on top of each function? 47



  python, tensorflow, tensorflow2.0



  asked by
  
  
    Leevo
  
  on 06:32PM - 13 Mar 19 UTC