Skip to content
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

"Default session has been garbage collected" #4071

Closed
tijmentieleman opened this issue Aug 27, 2016 · 4 comments
Closed

"Default session has been garbage collected" #4071

tijmentieleman opened this issue Aug 27, 2016 · 4 comments
Assignees

Comments

@tijmentieleman
Copy link
Contributor

The following three lines give an error: "RuntimeError: Default session has been garbage collected." One line above the line that raises the RuntimeError, there's a comment saying "This should never happen with the current session implementations." Clearly, it did happen. The situation doesn't bother me greatly, and I'm only mentioning this because clearly something unintended happened here.

import tensorflow as tf
with tf.Session().as_default():
tf.get_default_session()

The following four lines do not give the error:

import tensorflow as tf
sess = tf.Session()
with sess.as_default():
tf.get_default_session()

This suggests that the Session.as_default() method doesn't store in any way that keeps it from being garbage collected.

NOTE: Only file GitHub issues for bugs and feature requests. All other topics will be closed.

For general support from the community, see StackOverflow.
To make bugs and feature requests more easy to find and organize, we close issues that are deemed
out of scope for GitHub Issues and point people to StackOverflow.

For bugs or installation issues, please provide the following information.
The more information you provide, the more easily we will be able to offer
help and advice.

What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?

None.

Environment info

Operating System:

Mac OS X 10.11.6

Installed version of CUDA and cuDNN:
(please attach the output of ls -l /path/to/cuda/lib/libcud*):

None.

If installed from binary pip package, provide:

  1. A link to the pip package you installed: I don't recall the link; I installed following the standard installation instructions.
  2. The output from python -c "import tensorflow; print(tensorflow.__version__)".

0.10.0rc0

If installed from source, provide

  1. The commit hash (git rev-parse HEAD)
  2. The output of bazel version

If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)

See above.

What other attempted solutions have you tried?

See above.

Logs or other output that would be helpful

(If logs are large, please upload as attachment or provide link).

@poxvoculi poxvoculi added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Aug 30, 2016
@mrry
Copy link
Contributor

mrry commented Aug 31, 2016

Looks like an easy fix. It's in review now and should appear in the next push.

@mrry mrry removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Aug 31, 2016
@tijmentieleman
Copy link
Contributor Author

Sweet :)

@MakeWater
Copy link

still unsolved ?

@mrry
Copy link
Contributor

mrry commented Oct 30, 2017

@MakeWater Please open a new issue with a reproduction if you're still running into this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants