Tensorflow: ValueError : Variable proj_w already exists, disallowed. did you mean to set reuse=true in VarScope?

Created on 21 Jun 2016  ·  1Comment  ·  Source: tensorflow/tensorflow

GitHub issues are for bugs / installation problems / feature requests.
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.

Environment info

Operating System:

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

  1. The output from python -c "import tensorflow; print(tensorflow.__version__)". 0.8

If installed from sources, provide the commit hash:

Steps to reproduce

I have created a REST webservice to execute machine translation with some modifications in translate.py. If I run decode function in translate.py alone, on multiple runs I get the right output. But when I try to run the decode function through the webservice that I have created, the first time, I get the translation result. But on the second iteration, I get an error mentioned in the title.

What have you tried?

  1. I tried to close the session at the end of decode function in translate.py.

    Logs or other output that would be helpful

(If logs are large, please upload as attachment).
logs-1.txt

>All comments

This sounds like more like a question for Stack Overflow than a bug in TensorFlow, and we'll need more details to answer definitively.

However, I suspect the problem is that you're rebuilding the graph in each request, and there is some collision between the shared variables. The best approach would be to create the graph once and reuse it for all requests. A quick workaround would be to wrap your call to demo1.demo(input) in a with tf.Graph().as_default(): block, to ensure that the model is recreated in an empty graph.

Was this page helpful?
0 / 5 - 0 ratings