You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Using a tf.Tensor as a Python bool is not allowed. Use if t is not None: instead of if t: to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
#15
Open
atulkoc opened this issue
Feb 7, 2018
· 5 comments
i don't exactly know why i am facing this error.any solutions to it.
File "/home/atul/Desktop/train.py", line 196, in
pred = colornet(tensors)
File "/home/atul/Desktop/train.py", line 67, in colornet
conv1 = tf.nn.relu(tf.nn.conv2d(batch_norm(_tensors["conv4_3"], 512, phase_train),_tensors["weights"]["wc1"], [1, 1, 1, 1], 'SAME'))
File "/home/atul/Desktop/train.py", line 45, in batch_norm
x = bn.normalize(x, train=phase_train)
File "/home/atul/Desktop/batchnorm.py", line 45, in normalize
if train:
File "/home/atul/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 620, in nonzero
raise TypeError("Using a tf.Tensor as a Python bool is not allowed. "
TypeError: Using a tf.Tensor as a Python bool is not allowed. Use if t is not None: instead of if t: to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
The text was updated successfully, but these errors were encountered:
atulkoc
changed the title
i don't exactly know why i am facing this error.any solutions to it.
TypeError: Using a tf.Tensor as a Python bool is not allowed. Use if t is not None: instead of if t: to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
Feb 7, 2018
i don't exactly know why i am facing this error.any solutions to it.
File "/home/atul/Desktop/train.py", line 196, in
pred = colornet(tensors)
File "/home/atul/Desktop/train.py", line 67, in colornet
conv1 = tf.nn.relu(tf.nn.conv2d(batch_norm(_tensors["conv4_3"], 512, phase_train),_tensors["weights"]["wc1"], [1, 1, 1, 1], 'SAME'))
File "/home/atul/Desktop/train.py", line 45, in batch_norm
x = bn.normalize(x, train=phase_train)
File "/home/atul/Desktop/batchnorm.py", line 45, in normalize
if train:
File "/home/atul/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 620, in nonzero
raise TypeError("Using a
tf.Tensor
as a Pythonbool
is not allowed. "TypeError: Using a
tf.Tensor
as a Pythonbool
is not allowed. Useif t is not None:
instead ofif t:
to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.The text was updated successfully, but these errors were encountered: