Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: pred must not be a Python bool running train_bert_toy_task.py #110

Open
MNCTTY opened this issue Feb 13, 2019 · 0 comments
Open

Error: pred must not be a Python bool running train_bert_toy_task.py #110

MNCTTY opened this issue Feb 13, 2019 · 0 comments

Comments

@MNCTTY
Copy link

MNCTTY commented Feb 13, 2019

Hi,

I try to run this version of Bert (train_bert_toy_task.py) on my pc and an error arises:

pred must not be a Python bool

I tried to solve it, replacing True with tf.constant(True, dtype=tf.bool), but it induced the other error:

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.

I noticed that the error "pred must not be a Python bool" is also in line 31, where we have no explicit True value, but in bert_train_fn we have use_one_hot_embeddings that is the reason of error.

I don't know if it matter, but the very first error were "no module modeling" that is imported in every .py file in this repository. I decided that it was meant bert_modeling, so the bert_modeling.py exists in this repository. But may be I made a mistake? If so what kind of modeling was meant?

Thank you

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

No branches or pull requests

1 participant