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
tf_upgrade_v2 fails if the file contains f-strings and gives pasta.base.annotate.AnnotationError #26486
Comments
I'm having exactly the same problem when trying to migrate to tensorflow==2.0.0-alpha0 using the |
I've encountered the same bug. A test file: #! /usr/bin/env /usr/bin/python3 import tensorflow as tf tf.enable_eager_execution() I've attached the Traceback. |
This is an issue in google_pasta, a library we use to write that script in. I've escalated it to the maintainers and will ping back here soon. |
Sorry for the trouble here, this will be addressed as part of google/pasta#58. |
same here, waiting for this to upgraded, so I can upgrade it as well for http://tf2up.ml/ |
@soupytwist Should this problem be fixed now? I am using google_pasta 0.1.6 now and am still experiencing this issue. |
@kriskorrel-cw yes, it's fixed in nightly builds for quite some time |
I think we can also close the issue |
I have the following (minimal) code example that tf_upgrade_v2 can't pass.
I believe I have the correct pasta version:
Do you also experience this error @lc0 ? In that case, I don't think it can be closed |
@kriskorrel-cw I think the truth is somewhere in the middle. It does work for simpler cases like foo = 'bar'
a, b = 1, 2
print(f"{foo} : {a+b}") But does fail for your case. For more examples please see the colab example below https://colab.research.google.com/drive/1_hWyz2x_SwN0R0Jo1G0OCBeybmPkLlzC#scrollTo=a9l0KRPYu0JK I think in this case would make sense to reference this case for |
Thank you for the test case to reproduce this. Revisiting this now. |
It should be fixed in |
I just tested with todays nightly and the issue is resolved - I can convert the file that failed before. Thanks @soupytwist! I think if @MaximilianProll does not have any objections we can close this issue cc @alextp |
I received the The detailed error is:
The current code was written in TF-1.14. update: I fixed this by removing all code that includes |
Hi @richardwth, |
I have tried to upgrade to tf2 : I am working with with Windows 10 - anaconda - spyder 4.1.5 - python 3.7 and
I don't know what to do anymore. |
System information
Describe the current behavior
tf_upgrade_v2
fails if the file contains f-stringsDescribe the expected behavior
tf_upgrade_v2
does not fails if the file contains f-stringsCode to reproduce the issue
File
foo.py
:Command that produces the error:
tf_upgrade_v2 --infile foo.py --outfile foo_tf20.py
Other info / logs
The text was updated successfully, but these errors were encountered: