{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22362","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22362/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22362/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22362/events","html_url":"https://github.com/tensorflow/tensorflow/issues/22362","id":361502815,"node_id":"MDU6SXNzdWUzNjE1MDI4MTU=","number":22362,"title":"Impossible to initialize Variable, restored from a model, in Java API?","user":{"login":"okdzhimiev","id":7122484,"node_id":"MDQ6VXNlcjcxMjI0ODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7122484?v=4","gravatar_id":"","url":"https://api.github.com/users/okdzhimiev","html_url":"https://github.com/okdzhimiev","followers_url":"https://api.github.com/users/okdzhimiev/followers","following_url":"https://api.github.com/users/okdzhimiev/following{/other_user}","gists_url":"https://api.github.com/users/okdzhimiev/gists{/gist_id}","starred_url":"https://api.github.com/users/okdzhimiev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okdzhimiev/subscriptions","organizations_url":"https://api.github.com/users/okdzhimiev/orgs","repos_url":"https://api.github.com/users/okdzhimiev/repos","events_url":"https://api.github.com/users/okdzhimiev/events{/privacy}","received_events_url":"https://api.github.com/users/okdzhimiev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"asimshankar","id":16018,"node_id":"MDQ6VXNlcjE2MDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16018?v=4","gravatar_id":"","url":"https://api.github.com/users/asimshankar","html_url":"https://github.com/asimshankar","followers_url":"https://api.github.com/users/asimshankar/followers","following_url":"https://api.github.com/users/asimshankar/following{/other_user}","gists_url":"https://api.github.com/users/asimshankar/gists{/gist_id}","starred_url":"https://api.github.com/users/asimshankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimshankar/subscriptions","organizations_url":"https://api.github.com/users/asimshankar/orgs","repos_url":"https://api.github.com/users/asimshankar/repos","events_url":"https://api.github.com/users/asimshankar/events{/privacy}","received_events_url":"https://api.github.com/users/asimshankar/received_events","type":"User","site_admin":false},"assignees":[{"login":"asimshankar","id":16018,"node_id":"MDQ6VXNlcjE2MDE4","avatar_url":"https://avatars2.githubusercontent.com/u/16018?v=4","gravatar_id":"","url":"https://api.github.com/users/asimshankar","html_url":"https://github.com/asimshankar","followers_url":"https://api.github.com/users/asimshankar/followers","following_url":"https://api.github.com/users/asimshankar/following{/other_user}","gists_url":"https://api.github.com/users/asimshankar/gists{/gist_id}","starred_url":"https://api.github.com/users/asimshankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimshankar/subscriptions","organizations_url":"https://api.github.com/users/asimshankar/orgs","repos_url":"https://api.github.com/users/asimshankar/repos","events_url":"https://api.github.com/users/asimshankar/events{/privacy}","received_events_url":"https://api.github.com/users/asimshankar/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-09-18T22:08:34Z","updated_at":"2018-09-20T17:03:20Z","closed_at":null,"author_association":"NONE","body":"### System information\r\n- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**:\r\nYes\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:\r\nLinux Ubuntu 16.04\r\n- **Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device**:\r\nN/A\r\n- **TensorFlow installed from (source or binary)**:\r\nbinary via pom.xml:\r\n```\r\n<dependency>\r\n     <groupId>org.tensorflow</groupId>\r\n     <artifactId>libtensorflow</artifactId>\r\n     <version>1.10.0</version>\r\n </dependency>\r\n <dependency>\r\n     <groupId>org.tensorflow</groupId>\r\n     <artifactId>libtensorflow_jni_gpu</artifactId>\r\n     <version>1.10.0</version>\r\n </dependency>\r\n```\r\n\r\n- **TensorFlow version (use command below)**:\r\n1.10.0\r\n- **Python version**:\r\nUsing Java\r\n- **Bazel version (if compiling from source)**:\r\nN/A\r\n- **GCC/Compiler version (if compiling from source)**:\r\nN/A\r\n- **CUDA/cuDNN version**:\r\n9.0/7.0.5\r\n- **GPU model and memory**:\r\nGeForce GTX 750 Ti\r\n- **Exact command to reproduce**:\r\nN/A\r\n\r\n### Describe the problem\r\n\r\nTrying to run inference in Java from a restored model, getting:\r\n\r\n```java.lang.IllegalStateException: Attempting to use uninitialized value```\r\n\r\nSame thing works in Python.\r\n\r\nThe  model is not trivial - 2 stages with intermediate data stored in that uninitialized variable in GPU.\r\n\r\nTo workaround would like to initialize it. Looked through Operation and OperationBuilder classes - nothing.\r\n\r\nAble to get the variable using:\r\n```\r\nOperation ooyoo = bundle.graph().operation(\"rv_stage1_out\");\r\nSystem.out.println(ooyoo.toString());\r\nSystem.out.println(ooyoo.type());\r\n```\r\ngetting:\r\n```\r\n<VariableV2 'rv_stage1_out'>\r\nVariableV2\r\n```\r\n\r\nHow to assign?\r\n\r\n### Source code / logs\r\n[Code](https://git.elphel.com/Elphel/imagej-elphel/blob/gpu/src/main/java/TensorflowExamplePlugin.java)\r\n\r\nMore information as well as code and logs are posted on [Stackoverflow](https://stackoverflow.com/questions/52394799/tensorflow-1-10-0-java-api-java-lang-illegalstateexception-attempting-to-use-u).\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/423259183","html_url":"https://github.com/tensorflow/tensorflow/issues/22362#issuecomment-423259183","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22362","id":423259183,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzI1OTE4Mw==","user":{"login":"okdzhimiev","id":7122484,"node_id":"MDQ6VXNlcjcxMjI0ODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7122484?v=4","gravatar_id":"","url":"https://api.github.com/users/okdzhimiev","html_url":"https://github.com/okdzhimiev","followers_url":"https://api.github.com/users/okdzhimiev/followers","following_url":"https://api.github.com/users/okdzhimiev/following{/other_user}","gists_url":"https://api.github.com/users/okdzhimiev/gists{/gist_id}","starred_url":"https://api.github.com/users/okdzhimiev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okdzhimiev/subscriptions","organizations_url":"https://api.github.com/users/okdzhimiev/orgs","repos_url":"https://api.github.com/users/okdzhimiev/repos","events_url":"https://api.github.com/users/okdzhimiev/events{/privacy}","received_events_url":"https://api.github.com/users/okdzhimiev/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T17:03:20Z","updated_at":"2018-09-20T17:03:20Z","author_association":"NONE","body":"Silence is golden =)"}}
{"actor":{"display_login":"okdzhimiev"}}