ValueError: Input 0 of node conv1/bn/cond/ExponentialMovingAverage/AssignMovingAvg/Switch was passed float from conv1/bn/conv1/bn/moments/Squeeze/ExponentialMovingAverage:0 incompatible with expected float_ref.
Created by: lewhy2004
ValueError: Input 0 of node conv1/bn/cond/ExponentialMovingAverage/AssignMovingAvg/Switch was passed float from conv1/bn/conv1/bn/moments/Squeeze/ExponentialMovingAverage:0 incompatible with expected float_ref.
` batch_mean, batch_var = tf.nn.moments(inputs, moments_dims, name='moments') decay = bn_decay if bn_decay is not None else 0.9 ema=tf.train.ExponentialMovingAverage(decay=decay)
ema_apply_op = tf.cond(is_training, lambda: ema.apply([batch_mean, batch_var]), lambda: tf.no_op())
def mean_var_with_update(): with tf.control_dependencies([ema_apply_op]): return tf.identity(batch_mean), tf.identity(batch_var)
mean, var = tf.cond(is_training, mean_var_with_update, lambda: (ema.average(batch_mean), ema.average(batch_var))) normed = tf.nn.batch_normalization(inputs, mean, var, beta, gamma, 1e-3) `