{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/21893","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/21893/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/21893/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/21893/events","html_url":"https://github.com/tensorflow/tensorflow/issues/21893","id":354304727,"node_id":"MDU6SXNzdWUzNTQzMDQ3Mjc=","number":21893,"title":"Eager execution error: tf.enable_eager_execution must be called at program startup.","user":{"login":"josearcosaneas","id":8970750,"node_id":"MDQ6VXNlcjg5NzA3NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/8970750?v=4","gravatar_id":"","url":"https://api.github.com/users/josearcosaneas","html_url":"https://github.com/josearcosaneas","followers_url":"https://api.github.com/users/josearcosaneas/followers","following_url":"https://api.github.com/users/josearcosaneas/following{/other_user}","gists_url":"https://api.github.com/users/josearcosaneas/gists{/gist_id}","starred_url":"https://api.github.com/users/josearcosaneas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josearcosaneas/subscriptions","organizations_url":"https://api.github.com/users/josearcosaneas/orgs","repos_url":"https://api.github.com/users/josearcosaneas/repos","events_url":"https://api.github.com/users/josearcosaneas/events{/privacy}","received_events_url":"https://api.github.com/users/josearcosaneas/received_events","type":"User","site_admin":false},"labels":[{"id":386191887,"node_id":"MDU6TGFiZWwzODYxOTE4ODc=","url":"https://api.github.com/repos/tensorflow/tensorflow/labels/stat:awaiting%20response","name":"stat:awaiting response","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":{"login":"tatianashp","id":986732,"node_id":"MDQ6VXNlcjk4NjczMg==","avatar_url":"https://avatars2.githubusercontent.com/u/986732?v=4","gravatar_id":"","url":"https://api.github.com/users/tatianashp","html_url":"https://github.com/tatianashp","followers_url":"https://api.github.com/users/tatianashp/followers","following_url":"https://api.github.com/users/tatianashp/following{/other_user}","gists_url":"https://api.github.com/users/tatianashp/gists{/gist_id}","starred_url":"https://api.github.com/users/tatianashp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatianashp/subscriptions","organizations_url":"https://api.github.com/users/tatianashp/orgs","repos_url":"https://api.github.com/users/tatianashp/repos","events_url":"https://api.github.com/users/tatianashp/events{/privacy}","received_events_url":"https://api.github.com/users/tatianashp/received_events","type":"User","site_admin":false},"assignees":[{"login":"tatianashp","id":986732,"node_id":"MDQ6VXNlcjk4NjczMg==","avatar_url":"https://avatars2.githubusercontent.com/u/986732?v=4","gravatar_id":"","url":"https://api.github.com/users/tatianashp","html_url":"https://github.com/tatianashp","followers_url":"https://api.github.com/users/tatianashp/followers","following_url":"https://api.github.com/users/tatianashp/following{/other_user}","gists_url":"https://api.github.com/users/tatianashp/gists{/gist_id}","starred_url":"https://api.github.com/users/tatianashp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatianashp/subscriptions","organizations_url":"https://api.github.com/users/tatianashp/orgs","repos_url":"https://api.github.com/users/tatianashp/repos","events_url":"https://api.github.com/users/tatianashp/events{/privacy}","received_events_url":"https://api.github.com/users/tatianashp/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-08-27T12:47:49Z","updated_at":"2018-09-19T12:47:27Z","closed_at":null,"author_association":"NONE","body":"### System information\r\n\r\n- **Have I written custom code**: yes\r\n- **Bazel version**: N/A\r\n- **OS Platform and Distribution:** Windows 10\r\n- **CUDA/cuDNN version**: N/A\r\n- **GPU model and memory**: N/A\r\n- **Exact command to reproduce**: N/A\r\n- **TensorFlow installed from conda**\r\n- **TensorFlow version**: 1.9\r\n- **Python version**: 3.6\r\n- **Mobile device**: N/A\r\n\r\n### Describe the problem\r\n\r\nI have some errors using the eager execution. \r\n\r\nI have tried to perform an eager execution of a simple code. I've tried it on both Jupyter Notebook and Spyder IDE. \r\n\r\nThe code is as follows:\r\n\r\n                import tensorflow as tf\r\n                tf.enable_eager_execution ()\r\n                import tensorflow.contrib.eager as tfe\r\n\r\n                def square (x):\r\n                     return tf.multiply (x, x)\r\n\r\n                grad = tfe.gradients_function (square)\r\n                print (grad (3.))\r\n\r\n\r\nWhen I execute the code I get the following error:\r\n\r\n\r\n\tFile \"C:\\...\\lib\\site-packages\\tensorflow\\python\\framework\\ops.py\", line 5496, in enable_eager_execution \"tf.enable_eager_execution must be called at program startup.\")\r\n\r\n\tValueError: tf.enable_eager_execution must be called at program startup.\r\n\r\n\r\nIn Jupyter, In the first execution there are no errors but in the following ones. One way to fix it is by restarting the kernel.\r\n\r\nIn Spyder the error appears in the first execution I made. \r\nTo fix it I found two ways: \r\n\r\nOne rebooting the Spyder kernel and the second with a try / except:\r\n\r\n\t\ttry:\r\n\t\t     tf.enable_eager_execution ()\r\n\t\texcept Exception:\r\n\t\t         pass\r\n\r\n\r\nI leave the link to the question you make in Stackoverflow\r\n[(https://stackoverflow.com/questions/51967975/tf-enable-eager-execution-must-be-called-at-program-startup-only-in-spyder-ide)]\r\n\r\n\r\nI hope you find it helpful\r\n\r\n@alextp Thank you very much for your help."},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/422789313","html_url":"https://github.com/tensorflow/tensorflow/issues/21893#issuecomment-422789313","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/21893","id":422789313,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjc4OTMxMw==","user":{"login":"tensorflowbutler","id":28546240,"node_id":"MDQ6VXNlcjI4NTQ2MjQw","avatar_url":"https://avatars2.githubusercontent.com/u/28546240?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflowbutler","html_url":"https://github.com/tensorflowbutler","followers_url":"https://api.github.com/users/tensorflowbutler/followers","following_url":"https://api.github.com/users/tensorflowbutler/following{/other_user}","gists_url":"https://api.github.com/users/tensorflowbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflowbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflowbutler/subscriptions","organizations_url":"https://api.github.com/users/tensorflowbutler/orgs","repos_url":"https://api.github.com/users/tensorflowbutler/repos","events_url":"https://api.github.com/users/tensorflowbutler/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflowbutler/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T12:47:27Z","updated_at":"2018-09-19T12:47:27Z","author_association":"MEMBER","body":"It has been 22 days with no activity and the `awaiting response` label was assigned. Is this still an issue?"}}
{"actor":{"display_login":"tensorflowbutler"}}