'Tensorflow warning message (triggered tf.function retracing) could that be caused from pictures of different shape in my dataset?

I recive this error message when i try my network

WARNING:tensorflow:5 out of the last 5 calls to <function Model.make_train_function..train_function at 0x0000026FD735B430> 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 experimental_relax_shapes=True option that relaxes argument shapes 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.

I used the code form this github Is it possible that is error is caused by the fact that i am using pictures of different shape from my training dataset or the cause is something else?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source