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

fix variable reuse probolem #1739

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix variable reuse probolem #1739

wants to merge 1 commit into from

Conversation

zh794390558
Copy link

Traceback (most recent call last):
File "model/main.py", line 427, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "model/main.py", line 233, in main
train_model.create_model(UserModel, stage_scope)
File "/gfs/atlas/zhanghui/postfilter-gan/model/base.py", line 163, in create_model
y=batch_y_split[dev_i])
File "/gfs/atlas/zhanghui/postfilter-gan/model/base.py", line 240, in add_tower
tower = obj_tower(x, y, input_shape, self.nclasses, is_training, is_inference)
File "", line 41, in init
File "", line 119, in postfilter_gan_init
File "", line 142, in build_model
File "", line 291, in generator
File "/gfs/atlas/zhanghui/postfilter-gan/model/ops.py", line 80, in conv2d
initializer=tf.truncated_normal_initializer(stddev=stddev))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 367, in get_variable
validate_shape=validate_shape, use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter
use_resource=use_resource)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 664, in _get_single_variable
name, "".join(traceback.format_list(tb))))
ValueError: Variable generator/g_h0_conv/w already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

I have this problem in use this repo, may be this PR is the correct solution.

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

Successfully merging this pull request may close these issues.

None yet

1 participant