{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/8377","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/8377/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/8377/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/8377/events","html_url":"https://github.com/fchollet/keras/pull/8377","id":271059955,"number":8377,"title":"Remove unintended session initialization on TF backend","user":{"login":"datumbox","id":5347466,"avatar_url":"https://avatars1.githubusercontent.com/u/5347466?v=4","gravatar_id":"","url":"https://api.github.com/users/datumbox","html_url":"https://github.com/datumbox","followers_url":"https://api.github.com/users/datumbox/followers","following_url":"https://api.github.com/users/datumbox/following{/other_user}","gists_url":"https://api.github.com/users/datumbox/gists{/gist_id}","starred_url":"https://api.github.com/users/datumbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datumbox/subscriptions","organizations_url":"https://api.github.com/users/datumbox/orgs","repos_url":"https://api.github.com/users/datumbox/repos","events_url":"https://api.github.com/users/datumbox/events{/privacy}","received_events_url":"https://api.github.com/users/datumbox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-03T17:36:51Z","updated_at":"2017-11-03T18:01:55Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/8377","html_url":"https://github.com/fchollet/keras/pull/8377","diff_url":"https://github.com/fchollet/keras/pull/8377.diff","patch_url":"https://github.com/fchollet/keras/pull/8377.patch"},"body":"This PR tries to address the issues https://github.com/fchollet/keras/issues/8353, https://github.com/fchollet/keras/issues/8311 and https://github.com/fchollet/keras/issues/8374. Unfortunately they affect each other.\r\n\r\nA recent PR https://github.com/fchollet/keras/pull/8021 added a check at the beginning of the [tensorflow_backend.py](https://github.com/fchollet/keras/blob/master/keras/backend/tensorflow_backend.py#L50) to determine the number of available GPUs. Unfortunately the `tensorflow.python.client.device_lib.list_local_devices()` method seems to create of a new TF Session and to register of all the available GPUs on the system. To resolve this I replace all the `device_lib.list_local_devices()` calls with `K.get_session().list_devices()`. \r\n\r\nMoreover on commit https://github.com/fchollet/keras/commit/9166733c3c144739868fe0c30d57b861b4947b44 line 174, if the `candidate_vars` is empty we call `session.run()` with an empty list which causes a RuntimeException. This is addressed by checking if the variable is empty.\r\n\r\nNOTE: The unit-tests passed on my machine but I've been having issues with timeouts today on Travis. Please check the code, don't merge directly. Happy to update the PR if necessary based on feedback."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/341782073","html_url":"https://github.com/fchollet/keras/pull/8377#issuecomment-341782073","issue_url":"https://api.github.com/repos/fchollet/keras/issues/8377","id":341782073,"user":{"login":"ahundt","id":55744,"avatar_url":"https://avatars1.githubusercontent.com/u/55744?v=4","gravatar_id":"","url":"https://api.github.com/users/ahundt","html_url":"https://github.com/ahundt","followers_url":"https://api.github.com/users/ahundt/followers","following_url":"https://api.github.com/users/ahundt/following{/other_user}","gists_url":"https://api.github.com/users/ahundt/gists{/gist_id}","starred_url":"https://api.github.com/users/ahundt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahundt/subscriptions","organizations_url":"https://api.github.com/users/ahundt/orgs","repos_url":"https://api.github.com/users/ahundt/repos","events_url":"https://api.github.com/users/ahundt/events{/privacy}","received_events_url":"https://api.github.com/users/ahundt/received_events","type":"User","site_admin":false},"created_at":"2017-11-03T18:01:55Z","updated_at":"2017-11-03T18:01:55Z","author_association":"NONE","body":"these look like nice changes"}}
{"actor":{"display_login":"ahundt"}}