Skip to content

Bug: Exception ignored in BaseSession.__del__ #3388

@Hvass-Labs

Description

@Hvass-Labs

Hello Everyone,

The following code produces an error in TensorFlow:

import tensorflow as tf

a = tf.constant(123)
b = tf.constant(456)
c = a * b

session = tf.Session()

# A slightly different error is produced if this is removed.
session.run(tf.initialize_all_variables())

result = session.run(c)

print(result)

session.close()    # The error is produced regardless of this.

#quit()            # This produces the error.

import sys
sys.exit()         # This also produces the error.

This is the contents of sandbox3.py which I run in PyCharm.

The output is:

/home/magnus/anaconda3/envs/tensorflow/bin/python /home/magnus/development/TensorFlow-Tutorials/sandbox3.py
56088
Exception ignored in: <bound method BaseSession.__del__ of <tensorflow.python.client.session.Session object at 0x7fb4ecd301d0>>
Traceback (most recent call last):
  File "/home/magnus/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 171, in __del__
  File "/home/magnus/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 167, in close
AttributeError: 'NoneType' object has no attribute 'raise_exception_on_not_ok_status'

Process finished with exit code 0

I'm using the following versions:

  • TensorFlow 0.9.0 CPU installed from binary.
  • Python 3.5.1
  • Anaconda 2.5.0
  • PyCharm 5.0.4
  • Linux Mint 17.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions