tensorflow: AttributeError: 'NoneType' object has no attribute 'TF_NewStatus
In the latest sources the issue: https://github.com/tensorflow/tensorflow/issues/3388 is fixed in the thensorflow/python/client/session.py, But I now receive the following error instead:
Exception ignored in: <bound method BaseSession.__del__ of <tensorflow.python.client.session.Session object at 0x7fb2e08cee48>>
Traceback (most recent call last):
File "$HOME/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 595, in __del__
AttributeError: 'NoneType' object has no attribute 'TF_NewStatus'
I compiled the model manually using the latest version sources and using Bazel 0.4.5. The same seems to be true as with the issue 3388: The error is not always popping up and the run seems to have ended normally. However, now and then to above error message is displayed.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 32 (4 by maintainers)
Commits related to this issue
- Catch exception on tf_session.TF_NewStatus() "try" and "finally" without "except" is not sufficient to catch the exception. If the exception gets thrown, it can stop output from other threads from b... — committed to sffc/tensorflow by sffc 7 years ago
- Catch exception on tf_session.TF_NewStatus() "try" and "finally" without "except" is not sufficient to catch the exception. The exception makes TensorFlow appear to be broken. Fixes #8652 — committed to sffc/tensorflow by sffc 7 years ago
- Catch exception on tf_session.TF_NewStatus() (#9575) * Catch exception on tf_session.TF_NewStatus() "try" and "finally" without "except" is not sufficient to catch the exception. The exception ma... — committed to tensorflow/tensorflow by sffc 7 years ago
- Update load_ann_model.py added import tensorflow as tf to avoid a weird tensorflow and keras bug/error message https://github.com/tensorflow/tensorflow/issues/8652 — committed to a-n-rose/diagnosis-via-speech by a-n-rose 6 years ago
- Bug fixing a strange error message that only randomly occurred, see https://github.com/tensorflow/tensorflow/issues/8652 Solution of Nimi42 worked for me as well. — committed to juebrauer/teaching_deep_learning by deleted user 5 years ago
Hi, I also have this issue. It pops up from time to time. Keras 2.0.3 and tensorflow 1.1.0.
I get the same error.
Using this line at the end of the code seems to fix it It feels like a work around though.
I had the same problem and checking the code in the file /lib/python3.5/site-packages/tensorflow/python/client/session.py shows this:
the error could be avoided with something like this:
Solution of Nimi42 worked for me as well to solve this issue. I added:
from keras import backend as K K.clear_session()
Using python 3.5.2, tf 1.9, and tensorflow.contrib.keras
Seeing this issue intermittently as well. It is fairly annoying as it sometimes splits my output in half.
I’m using tensorflow 1.5.0 via docker (gcr.io/tensorflow/tensorflow:1.5.0-devel-gpu-py3) and keras 2.1.3. The following exception sometimes occurs:
I’m not sure if it’s related, but other times my script does not exit and keeps hanging. This makes automatic parameter tuning a hassle.
I’m not sure if this is the same error or not; it’s saying not callable rather than the attribute, but seems to be in the same method anyway…
using tensorflow 1.4.1 in docker, using
tensorflow/tensorflow:latest-gpu-py3not using keras, but I am usingsess = tf.Session()andsess.close()instead ofwith tf.Session() as sess:but that doesn’t seem to be sufficient to recreate the error reliably in say ipython3, it only happens when I run my script. perhaps some sort of race condition?Dear skye,
thank you for your response. Triggered by your question, I found out that this issue is only occurring when using the Keras module. When I use the Tensorflow module directly I’m not able to reproduce the issue. I assumed that the tensorflow was the issue, as issue #3388 was also occurring at the same moment when I ran my Keras test scripts. Next to that, the error message also reported the issue was occurring in the session.py python script that is part of tensorflow. I will report the issue at the Keras project. Sorry for the inconvenience…