8000 Fix "Using a `tf.Tensor` as a Python `bool` is not allowed" by SnowWalkerJ · Pull Request #541 · tflearn/tflearn · GitHub
[go: up one dir, main page]

Skip to content

Fix "Using a tf.Tensor as a Python bool is not allowed"#541

Open
SnowWalkerJ wants to merge 1 commit intotflearn:masterfrom
SnowWalkerJ:my_edit
Open

Fix "Using a tf.Tensor as a Python bool is not allowed"#541
SnowWalkerJ wants to merge 1 commit intotflearn:masterfrom
SnowWalkerJ:my_edit

Conversation

@SnowWalkerJ
Copy link

At the current version of tflearn, using some modules could end up with:

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.

So I replaced some judgements like "if b:" to "if b is not None" to avoid this.

@aymericdamien
Copy link
Member

Thanks for fixing this issue! Unfortunately the PR breaks due to the latest tflearn update. If you got time, would you mind rebase your code? Thanks!

@zxydi1992
Copy link

Can someone fix that?

@aldanor
Copy link
aldanor commented Jul 16, 2017

This should be closed ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0