Ask questionsAutoGraph unexpected indent in tf-nightly-gpu-2.1.0.dev20191103
Describe the current behavior
After upgrading to
tensorflow-gpu-2.0.0, I obtained this error when running my code:
WARNING:tensorflow:AutoGraph could not transform <bound method CRFLayer.mean_field of <models.crf_layer.CRFLayer object at 0x7f6124237b00>> and will run it as-is. Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: unexpected indent (<unknown>, line 36)
export AUTOGRAPH_VERBOSITY=10 but did not observe any other types of output other than the above. It says unexpected indent so I guess something changed in the parsing of Python code when building the graph? The problem does not occur on
tensorflow-gpu-2.0.0 (I installed
tf-nightly-gpu-2.1.0.dev20191103 because I need to be able to
load_weights(pretrained_weights, by_name=True, skip_mismatch=True), which is not available in 2.0.0. There is another bug with this function that I will report in a separate issue.)
Describe the expected behavior Like in TF 2.0.0: no AutoGraph warning.
Code to reproduce the issue Unfortunately my code has a lot of dependencies and I was unable to create a minimal reproducible example. But from the warning message I guess it's easy enough to check in the source code.
Answer questions mdanatg
Backslash continuations should now be properly supported; the fix is in tf-nightly and will be available in TF 2.2.