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

Compatible with Tensorflow 2.1 #2115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Compatible with Tensorflow 2.1 #2115

wants to merge 1 commit into from

Conversation

jiapei100
Copy link

Tested, works fine with TF 2.1

@pbischoff
Copy link

TF 2.1 doesn't have tf.random_shuffle. Instead it uses tf.random.shuffle

@ablaw123
Copy link

Thanks... This works well for inference but there are still errors when trying to train on a new dataset.

this is the error I get when trying to train. This is after I made the change from tf.random_shuffle. to tf.random.shuffle

tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a tf.Tensor as a Python bool is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.

@cl2227619761
Copy link

Thanks... This works well for inference but there are still errors when trying to train on a new dataset.

this is the error I get when trying to train. This is after I made the change from tf.random_shuffle. to tf.random.shuffle

tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a tf.Tensor as a Python bool is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.

Add tf.compat.v1.disable_eager_execution() in the first line will be ok

@KossBoii
Copy link

KossBoii commented May 26, 2020

Thanks... This works well for inference but there are still errors when trying to train on a new dataset.
this is the error I get when trying to train. This is after I made the change from tf.random_shuffle. to tf.random.shuffle

tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a tf.Tensor as a Python bool is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.

Add tf.compat.v1.disable_eager_execution() in the first line will be ok

@cl2227619761 which file and where do you put this line of code?

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.

5 participants