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 ppo2_model/pi/mlp_fc0/w/Adam/ already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? #4

Closed
MatPoliquin opened this issue Aug 21, 2019 · 1 comment

Comments

@MatPoliquin
Copy link

MatPoliquin commented Aug 21, 2019

When running in openai_ppo
python3 ./run.py --bsuite_id=SWEEP

I get this error:
ValueError: Variable ppo2_model/pi/mlp_fc0/w/Adam/ already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope?

I ran test.sh and all the tests passes

  • python 3.6
  • tensorflow 1.14
  • Ubuntu 18.10

Here is the log:

`
[Last finished: bandit/15]: 3%|███▋ | 15/468 [34:10<88:11:07, 700.81s/it]concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/lib/python3.6/concurrent/futures/process.py", line 153, in _process_chunk
return [fn(*args) for args in chunk]
File "/usr/lib/python3.6/concurrent/futures/process.py", line 153, in
return [fn(*args) for args in chunk]
File "./run.py", line 81, in run
gamma=FLAGS.agent_discount,
File "/home/amdfanboy/github/baselines-youtube/baselines/ppo2/ppo2.py", line 108, in learn
File "/home/amdfanboy/github/baselines-youtube/baselines/ppo2/model.py", line 111, in init
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py", line 595, in apply_gradients
self._create_slots(var_list)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/training/adam.py", line 135, in _create_slots
self._zeros_slot(v, "m", self._name)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/training/optimizer.py", line 1153, in _zeros_slot
new_slot_variable = slot_creator.create_zeros_slot(var, op_name)
File "/home/amdfanboy/vbsuite/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/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/training/slot_creator.py", line 157, in create_slot_with_initializer
dtype)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/training/slot_creator.py", line 65, in _create_slot_var
validate_shape=validate_shape)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1479, in get_variable
aggregation=aggregation)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1220, in get_variable
aggregation=aggregation)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 547, in get_variable
aggregation=aggregation)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 499, in _true_getter
aggregation=aggregation)
File "/home/amdfanboy/vbsuite/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 848, in _get_single_variable
traceback.format_list(tb))))
ValueError: Variable ppo2_model/pi/mlp_fc0/w/Adam/ already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "/home/amdfanboy/github/baselines-youtube/baselines/ppo2/model.py", line 111, in init
File "/home/amdfanboy/github/baselines-youtube/baselines/ppo2/ppo2.py", line 108, in learn
File "./run.py", line 81, in run
gamma=FLAGS.agent_discount,

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "./run.py", line 107, in
app.run(main)
File "/home/amdfanboy/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/home/amdfanboy/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "./run.py", line 100, in main
pool.map_mpi(run, bsuite_sweep)
File "/home/amdfanboy/github/bsuite/bsuite/baselines/utils/pool.py", line 53, in map_mpi
for bsuite_id in pool.map(run_fn, bsuite_ids):
File "/usr/lib/python3.6/concurrent/futures/process.py", line 366, in _chain_from_iterable_of_lists
for element in iterable:
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
ValueError: Variable ppo2_model/pi/mlp_fc0/w/Adam/ already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "/home/amdfanboy/github/baselines-youtube/baselines/ppo2/model.py", line 111, in init
File "/home/amdfanboy/github/baselines-youtube/baselines/ppo2/ppo2.py", line 108, in learn
File "./run.py", line 81, in run
gamma=FLAGS.agent_discount,

`

@iosband
Copy link
Contributor

iosband commented Sep 3, 2019

Hi there - I've had a look at this and can't reproduce that behaviour.

My guess is that your OpenAI baselines:
"/home/amdfanboy/github/baselines-youtube/baselines/ppo2/ppo2.py"

Does not match the OpenAI baselines this script is meant to run:
https://github.com/openai/baselines

I can confirm that if you follow the installation instructions from a fresh workspace you will be able to run the script successfully.
Feel free to re-open if that is not the case.

Thanks!

@iosband iosband closed this as completed Sep 3, 2019
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