<locals>.predict_function at 0x000001F9D1C05EE0> triggered tf.function retracing.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<locals>.predic
tf.constant(3, shape=(1, 42), dtype='float32')
print(model.predict(x)) # works fine
x += 5
print(f(x)) 运行这段简单的代码会产生 ValueError调用位于@tf.function内部的model.predict时。