From c882a47eac340e9476be932157a45331f1622615 Mon Sep 17 00:00:00 2001 From: Viet-Anh Nguyen Date: Thu, 14 Nov 2019 11:27:30 +0700 Subject: [PATCH] Fixbug: Using a `tf.Tensor` as a Python `bool` --- 4-Object_Detection/YOLOV3/core/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4-Object_Detection/YOLOV3/core/common.py b/4-Object_Detection/YOLOV3/core/common.py index 88cc8884..fc473e1f 100644 --- a/4-Object_Detection/YOLOV3/core/common.py +++ b/4-Object_Detection/YOLOV3/core/common.py @@ -21,7 +21,7 @@ class BatchNormalization(tf.keras.layers.BatchNormalization): and `beta` will not be updated ! """ def call(self, x, training=False): - if not training: + if isinstance(training, bool) and training == False: training = tf.constant(False) training = tf.logical_and(training, self.trainable) return super().call(x, training)