-
Notifications
You must be signed in to change notification settings - Fork 74.2k
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
WARNING:tensorflow:AutoGraph could not transform 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.
#37144
Comments
I have tried in colab with TF 2.1.0 and i am not seeing any issue. Please, find the gist here.I have made few assumptions in code while executing. If you feel there is an issue please do update in attached colab and help me to reproduce the issue. It helps me in localizing the issue faster. Thanks! |
Thanks. there's no problem with colab. But there's always a warning when using spyder in anaconda tensorflow. It seems there's no influence on the results, but I'm not sure if it will influence the speed. |
You can safely ignore the warning log as its intended to debug logging in AutoGraph issues. Thanks ! |
Yes, this problem still exists. |
The warning will not hurt performance, but I'm curious as to what the cause might be. Can you add this line just before importing tensorflow: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
Hello, I have used
|
Hope this could help solve the issue. |
@KaticaR thank you for the logs, they seem to indicate an incompatibility with the toolchain, though it's unclear which piece. At any rate, the faulting piece was refactored recently. If you have the chance, please retry with tf-nightly. |
Hi I got this as well, and as the message says I set the env variable and recorded the stack trace:
I was running |
When we downgraded the versions of keras and tensorflow to match, then the error disappointed. |
Sorry, for 2.2 please use |
@mdanatg Thanks, the problem is fixed with this solution. |
sorry, would you please put your fix in order. what ds_train refers to? |
@spawnaga this workaround refers specifically to @mobassir94's code. It is not a general fix. Also note that the issue is fixed in tf-nightly. |
@fchollet might have better advice on active user groups who could answer @mobassir94's questions |
@mobassir94 Can you please detail it about below code (as i am getting same error in tensorflow api ) |
@shubhamgajbhiye1994 can you create a small snippet that we can run separately to reproduce the error you're seeing? That would help us give you better advice. |
I have this same issue. My error logs:
Code to reproduce:
I am on a MacBook Air (M1, 2020) running macOS Big Sur (11.4). |
Hi, we have solved the problem by setting the right versions of the
packages. Hope this info helps!
All the best,
Katica
…On Sun, Aug 15, 2021, 11:46 jda5 ***@***.***> wrote:
I have this same issue. My error logs:
WARNING:tensorflow:AutoGraph could not transform <function Model.make_predict_function.<locals>.predict_function at 0x13ffac310> 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: unsupported operand type(s) for -: 'NoneType' and 'int'
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert
2021-08-15 10:38:47.649790: I tensorflow/compiler/tf2mlcompute/kernels/mlc_subgraph_op.cc:326] Compute: Failed in processing TensorFlow graph sequential/MLCSubgraphOp_2_0 with frame_id = 0 and iter_id = 0 with error: Internal: ExecuteMLCInferenceGraph: Failed to execute MLC inference graph. (error will be reported 5 times unless TF_MLC_LOGGING=1).
2021-08-15 10:38:47.652117: F tensorflow/core/framework/op_kernel.cc:983] Check failed: outputs_[index].tensor == nullptr (0x13fd05cb0 vs. nullptr)
zsh: abort python test.py
Code to reproduce:
from tensorflow.keras.datasets import fashion_mnist
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, Flatten
from tensorflow.keras.losses import SparseCategoricalCrossentropy
(X_train, y_train), (X_test, y_test) = fashion_mnist.load_data()
X_train = X_train / 255
X_test = X_test / 255
model = Sequential([
Flatten(input_shape=X_train.shape[1:]),
Dense(30, activation='relu'),
Dense(30, activation='relu'),
Dense(10, activation='softmax')
])
model.compile(optimizer='adam',
loss=SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
model.fit(X_train, y_train, epochs=30)
y_pred = model.predict(X_test) # <--- Error occurs here
print(np.argmax(predictions[0]))
I am on a MacBook Air (M1, 2020) running macOS Big Sur (11.4).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#37144 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGZMARMZSRCENOE53K7AGWTT46EFPANCNFSM4K5DJK3A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Would you be more specific? What right versions? How to set them. |
|
Could you set the verbosity to 3 and include the log messages, along with the pip package versions that you used? That would help reproduce the issue. I tried the snippet in colab on the stable version, but couldn't reproduce it. |
It would also be a good idea to file a new issue - this warning is very generic and could signal many different issues. |
|
@liqinglin54951 that looks like an incompatible version of gast. Could you try 0.3.0? |
I have python 3.9.6, windows 10, tensorflow 2.6, I got the following error, Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, the verbos has been set to 10, this is the final report OSError: Unable to create file (unable to open file: name = 'D:/TESTS/building_detection/Data/Checkpoints\weights.01-0.93.hdf5', errno = 24, error message = 'Too many open files', flags = 13, o_flags = 302) same code has been used with other data, I didn't get this message. |
Hi everyone! I've had the same warnings and suddenly found out that they are caused by jupyter's magic commands. It was I didn't do a very thorough research, but as far as I understand, it happens due to magic commands wrapping the cells with code into some object or something. So when TensorFlow tries to get the source code with Thus, avoid using jupyter's magic commands along with the tensorflow, they can cause this warning. And also the rule of thumb here will be to avoid any decorating structures over |
That's a useful find. I suspect that it you put all your code in functions in a separate cell, and only call those functions from the |
@mdanatg, I tried this and it doesn't seem to work, unfortunately. I finally did a little research and I found out that
It confirms my hypothesis, but doesn't provide any hacks for our case. Trying to set function name as global (in the hope that it would make its name really global) didn't work for me either. |
I see, that makes sense. This is in fact a limitation of Python itself - in order for Anyhow, we ought to get this to work if any function that is wrapped by autograph is placed inside a Python file (and imported instead). In other words, no @tf.function call anywhere in the ipython code. We're basically looking for the following call stack (conceptually): ipython > timeit wrappers > module in a file > tf.function > autograph > rest of the code Assuming timeit just calls external functions without doing anything else to them, things should work that way. |
still facing this nerve-wracking warning in tensorflow 2.16.1 |
System information
Describe the current behavior
I'm using anaconda tensorflow, Spyder. When run my custom layers, it shows warning as below:
Describe the method I tried
I have already tried the solution which others provided: pip install gast==0.2.2
I also re-installed all of the softwares (anaconda, tensorflow, spyder).
However, these methods doesn't solve my problem.
Is there any other solution?
Standalone code to reproduce the issue
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.
The text was updated successfully, but these errors were encountered: