Creating variables on a non-first call to a function decorated with tf.function.解决方法!
Creating variables on a non-first call to a function decorated with tf.function.解决方法!
1. 如下图所示,使用该修饰器可加速网络的推理速度,但有时会报错Creating variables on a non-first call to a function decorated with tf.function.
2. 接下来只要在该修饰器上方加入该行代码即可
tf.config.run_functions_eagerly(True)