TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed.(self.conv1_2)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", linea `tf.Tensor` as a Python</em
我正在使用tf2,并且我想在同一模型上执行多个测试。因此,我正在初始化一些变量,预处理我的数据,然后训练模型。我的问题是,当我更改一些参数并尝试重新运行网络时,我得到了以下错误:
tf.function-decorated function tried to create variables on non-first我知道我可以删除@tf.function装饰器,但是这样运行起来就慢多了。我也尝试过运行K.clear_outputs(),但没有任何帮助。除了移除tf.function装饰器或重启运行时,还有什么我可以做的吗