tensorflow: tf Function could not able to transformed into graph.

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary):
  • TensorFlow version (use command below):
  • Python version:
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

You can collect some of this information using our environment capture script You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the current behavior

Describe the expected behavior

Code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem.

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (1 by maintainers)

Most upvoted comments

I was using gast 0.3.1 but switching to version 0.2.2 seems to have fixed this for me.

pip install gast==0.2.2

On Sun, Oct 6, 2019 at 8:28 AM lrxiao notifications@github.com wrote:

I was using gast 0.3.1 but switching to version 0.2.2 seems to have fixed this for me. Could you tell me how to switch the version?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/tensorflow/issues/32383?email_source=notifications&email_token=ABILJBMVOADWICCOM33UV2DQNGAQZA5CNFSM4IVILF5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAOCO6A#issuecomment-538716024, or mute the thread https://github.com/notifications/unsubscribe-auth/ABILJBISDWLJFCLN2BZWDQLQNGAQZANCNFSM4IVILF5A .

use gast 0.2.2 sovle my issue as well.

I also experienced this bug and finally sovled by switching to gast 0.2.2.

Duplicate of #32319 , which was fixed by c72125bd59858ec82a9238b232bbd77c45889c5a#diff-739fc4f018f5288972ae5826b15c36e7

However, according to @mihaimaruseac :

New update:

gast has been pinned to 0.2.2 for 1.15 and 2.0 and later releases as well as nightly. TF 1.14 or earlier don’t have gast pinned and won’t get it as we are not doing more releases there (except for security vulnerabilities).

If you encounter this issue on 1.14 or earlier, please install gast==0.2.2 using pip before installing tensorflow.