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

ValueError: Variable E_conv0/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope? #7

Closed
DWmon opened this issue Nov 10, 2018 · 2 comments

Comments

@DWmon
Copy link

DWmon commented Nov 10, 2018

I am using Tensor Flow version 1.12 and Python 3.6.
I don't know how to fix this error.

Traceback (most recent call last):
File "/home/math01/exprgan/joint-train/main.py", line 58, in
tf.app.run()
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "/home/math01/exprgan/joint-train/main.py", line 46, in main
num_epochs=FLAGS.epoch, # number of epochs
File "/home/math01/exprgan/joint-train/exprgan.py", line 267, in train
var_list=self.E_variables + self.G_variables
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py", line 410, in minimize
name=name)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py", line 593, in apply_gradients
self._create_slots(var_list)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/adam.py", line 135, in _create_slots
self._zeros_slot(v, "m", self._name)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py", line 1139, in _zeros_slot
new_slot_variable = slot_creator.create_zeros_slot(var, op_name)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/slot_creator.py", line 183, in create_zeros_slot
colocate_with_primary=colocate_with_primary)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/slot_creator.py", line 157, in create_slot_with_initializer
dtype)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/training/slot_creator.py", line 65, in _create_slot_var
validate_shape=validate_shape)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1487, in get_variable
aggregation=aggregation)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1237, in get_variable
aggregation=aggregation)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 540, in get_variable
aggregation=aggregation)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 492, in _true_getter
aggregation=aggregation)
File "/home/math01/anaconda3/envs/py363/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 879, in _get_single_variable
"reuse=tf.AUTO_REUSE in VarScope?" % name)
ValueError: Variable E_conv0/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=tf.AUTO_REUSE in VarScope?

Process finished with exit code 1

@DWmon DWmon closed this as completed Nov 10, 2018
@delian11
Copy link

I meet the same error, too. How did you solve it?

@DWmon
Copy link
Author

DWmon commented Oct 20, 2019 via email

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