Skip to content
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

Batch Norm Gamma Variable does not exist #5

Open
kofzor opened this issue Feb 3, 2017 · 1 comment
Open

Batch Norm Gamma Variable does not exist #5

kofzor opened this issue Feb 3, 2017 · 1 comment

Comments

@kofzor
Copy link

kofzor commented Feb 3, 2017

ValueError: Variable generator/layer_2/batch_norm/gamma does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

I think this has to do with tensorflow 0.12.1, as more people have issues with the variable scope & get_variable.

Do you happen to know what the following line should be?
gamma = tf.get_variable("gamma", [shp], initializer=tf.random_normal_initializer(1., 0.02), trainable=trainable)

Whole error:

generator architecture
Fully connected with num_outputs=1024 followed by relu
Fully connected with num_outputs=6272 followed by relu
Reshape to [7, 7, 128]
Traceback (most recent call last):
File "infogan/init.py", line 487, in
train()
File "infogan/init.py", line 267, in train
debug=True
File "infogan/init.py", line 47, in generator_forward
strip_batchnorm_from_last_layer=True)
File "/home/aiw/software/tensorflow-infogan/infogan/tf_utils.py", line 132, in run_network
scope='layer_%d' % (layer_idx,)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args
return func(*args, **current_args)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1106, in convolution2d_transpose
outputs = normalizer_fn(outputs, **normalizer_params)
File "/home/aiw/software/tensorflow-infogan/infogan/tf_utils.py", line 39, in conv_batch_norm
gamma = tf.get_variable("gamma", [shp], initializer=tf.random_normal_initializer(1., 0.02), trainable=trainable)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 1024, in get_variable
custom_getter=custom_getter)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 850, in get_variable
custom_getter=custom_getter)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 346, in get_variable
validate_shape=validate_shape)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 331, in _true_getter
caching_device=caching_device, validate_shape=validate_shape)
File "/home/aiw/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 650, in _get_single_variable
"VarScope?" % name)
ValueError: Variable generator/layer_2/batch_norm/gamma does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

@howardgriffin
Copy link

I have the similar problem,how did you solve the problem?And here is my error
ValueError: Variable discriminator/layer_0/batch_norm/discriminator_1/layer_0/batch_norm/discriminator_1/layer_0/batch_norm/moments/normalize/mean/ExponentialMovingAverage/biased does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants