-
Notifications
You must be signed in to change notification settings - Fork 130
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
tf.get_variable() error, variable does not exist or was not created #3
Comments
Maybe you could add: |
This worked for me! (tensorflow 1.0 alpha |
This do not worked for me! (tensorflow 1.0 nightly) Traceback (most recent call last):
|
It spent me two days to figure out the workaround and ends up with failure. It seems the reason is that although the fake_discriminator set the scope_reuse to be True, however, the tf.cond() statement will create a new control_flow every time, such that the get_variable() cannot retrieve the corresponding variables from the real_discriminator and throw a ValueError .../.../discriminator_1/disc_bn1/... blablabla. Bcuz according to my understanding, there shouldn't be a nested scope ../../discriminator_1 and nested ../../../disc_bn1. Tell me if I am wrong. |
@kunrenzhilu : could you be more specific about how you modify tf.contrib.layers.batch_norm() ? I am struggling with the same problem stated above. |
I have the same problem. After adding:
During handling of the above exception, another exception occurred:
|
Check this out. It seems to have fixed the problems for me. UPDATE: After training for 8+ hours with this change, the GAN seems to not learn anything and the loss ranges (for d_loss and g_loss) are way off. UPDATE 2: I trained with this commit and TF v1.1.0. It seems to have learned to produce faces. |
@AshishBora |
@kunrenzhilu could you give a concrete solution to the problem? I can hardly solve it either. |
@AshishBora your commits are giving a 404 for me, could you show how did you fixed it? |
@ayrtondenner I changed line 115 here to something like: h_bn = tf.contrib.layers.batch_norm(inputs=h_conv, decay=0.9, epsilon=1e-5, is_training=train_phase, scope="disc_bn%d" % index) |
I should change line 326 too, right? They are both batch_norm inside a discriminator network. |
Yup, that seems right. |
I'm already running it, seems like now it's going to work. Anyway, do you know why your commits are 404'd by now? |
Great. Oh, 404 is because I deleted my fork some time ago since I wasn't using it anymore. |
I see. I had to re-run it since there were still some minor changes because of TensorFlow 1.0 and compatibility issues. Anyway, do you still have these commits? It would be nice to see if you did any other code changes. |
I have a local copy of the whole repo. I have uploaded a zip here. |
I had the network training during 10 hours, 11k epochs, and that's the result I got. It still not a human face, but I wanted to know if the training is going ok or not, because as you said above, you can run the network but it doesn't mean its necessarily working. Also, I changed both |
On tensorflow 1.12.0, I had the same problem and fixed it by adding the line:
before ema.apply |
My tensorflow version is 0.12.1
when I run run_main.py, I got this error
"ValueError: Variable discriminator/disc_bn1/discriminator_1/disc_bn1/cond/discriminator_1/disc_bn1/moments/moments_1/mean/ExponentialMovingAverage/biased does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?"
Any one has any idea?
The text was updated successfully, but these errors were encountered: