<locals>.train_function at 0x7f128aee0ae8> triggered tf.function retracing.For (1), please define your @tf.function outside of the loop.: Detected a call to `Model.fit` inside a `tf.function`.`Model.fit is a high-level endpoint that manages its own `tf.functio
<locals>.predict_function at 0x000001B0A8CC90D0> 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
@tf.function调用位于@tf.function内部的model.predict时。 为什么会发生这种情况?我不应该在@tf.function中使用model.predict吗?或者换个方式做?
<locals>.predict_function at 0x2b18970e88c0> triggered tf.function retracing.For (1), please define your @tf.function outside of the loop.For (1), please define your @tf.function outside of the loop.For (1), please define your @tf.function outside of the