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 highway/highway_network/layer_0/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? #108

Open
yogesh-nikose opened this issue Dec 24, 2018 · 0 comments

Comments

@yogesh-nikose
Copy link

File "/home/u19872/.conda/envs/bert01/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/u19872/.conda/envs/bert01/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/u19872/bert01/bi-att-flow/basic/cli.py", line 126, in
tf.app.run()
File "/home/u19872/.conda/envs/bert01/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/u19872/bert01/bi-att-flow/basic/cli.py", line 123, in main
m(config)
File "/home/u19872/bert01/bi-att-flow/basic/main.py", line 23, in main
_train(config)
File "/home/u19872/bert01/bi-att-flow/basic/main.py", line 82, in _train
models = get_multi_gpu_models(config)
File "/home/u19872/bert01/bi-att-flow/basic/model.py", line 19, in get_multi_gpu_models
model = Model(config, scope, rep=gpu_idx == 0)
File "/home/u19872/bert01/bi-att-flow/basic/model.py", line 58, in init
self._build_forward()
File "/home/u19872/bert01/bi-att-flow/basic/model.py", line 128, in _build_forward
xx = highway_network(xx, config.highway_num_layers, True, wd=config.wd, is_train=self.is_train)
File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 222, in highway_network
input_keep_prob=input_keep_prob, is_train=is_train)
File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 210, in highway_layer
gate = linear([arg], d, bias, bias_start=bias_start, scope='gate', wd=wd, input_keep_prob=input_keep_prob, is_train=is_train)
File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 91, in linear
flat_out = _linear(flat_args, output_size, bias)
File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 61, in _linear
initializer=kernel_initializer)
File "/home/u19872/.conda/envs/bert01/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/home/u19872/.conda/envs/bert01/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/home/u19872/.conda/envs/bert01/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 367, in get_variable
validate_shape=validate_shape, use_resource=use_resource)
File "/home/u19872/.conda/envs/bert01/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter
use_resource=use_resource)
File "/home/u19872/.conda/envs/bert01/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 664, in _get_single_variable
name, "".join(traceback.format_list(tb))))
ValueError: Variable highway/highway_network/layer_0/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 61, in _linear
initializer=kernel_initializer)
File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 91, in linear
flat_out = _linear(flat_args, output_size, bias)
File "/home/u19872/bert01/bi-att-flow/my/tensorflow/nn.py", line 208, in highway_layer
trans = linear([arg], d, bias, bias_start=bias_start, scope='trans', wd=wd, input_keep_prob=input_keep_prob, is_train=is_train)

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

1 participant