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

fixes import from rllib #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sanjeevanahilan
Copy link

@sanjeevanahilan sanjeevanahilan commented Dec 13, 2019

maddpg is currently in rllib.contrib rather than rllib.agents

see ray-project/ray#6476

@jkterry1
Copy link

jkterry1 commented Dec 14, 2019

Hey, when I try running this PR to reproduce the results of the paper, I still get related issues, error log below. Given that NameError: Please run contrib/MADDPG instead is included three times, I assume it's related to this.

2019-12-14 17:57:42,143	INFO resource_spec.py:205 -- Starting Ray with 39.11 GiB memory available for workers and up to 2.79 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
2019-12-14 17:57:42,516	WARNING sample.py:31 -- DeprecationWarning: wrapping <function main.<locals>.<lambda> at 0x7f115303cd90> with tune.function() is no longer needed
2019-12-14 17:57:42,599	WARNING worker.py:348 -- WARNING: Falling back to serializing objects of type <class 'numpy.dtype'> by using pickle. This may be inefficient.
2019-12-14 17:57:42,608	WARNING worker.py:348 -- WARNING: Falling back to serializing objects of type <class 'mtrand.RandomState'> by using pickle. This may be inefficient.
(pid=12579) 2019-12-14 17:57:44,655	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 17:57:45,381	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray_MADDPG:train() (pid=12579, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 90, in __init__
    Trainer.__init__(self, config, env, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 492, in _setup
    self._init(self.config, self.env_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 109, in _init
    self.config["num_workers"])
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 537, in _make_workers
    logdir=self.logdir)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 64, in __init__
    RolloutWorker, env_creator, policy, 0, self._local_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 220, in _make_worker
    _fake_sampler=config.get("_fake_sampler", False))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 348, in __init__
    self._build_policy_map(policy_dict, policy_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 764, in _build_policy_map
    policy_map[name] = cls(obs_space, act_space, merged_conf)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 158, in __init__
    scope="actor"))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 368, in _build_actor_network
    sampler = tfp.distributions.RelaxedOneHotCategorical(
AttributeError: 'NoneType' object has no attribute 'distributions'
2019-12-14 17:57:45,386	INFO trial_runner.py:615 -- Attempting to recover trial state from last checkpoint.
2019-12-14 17:57:46,464	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(NameError): ray__SeeContrib:train() (pid=12582, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/__init__.py", line 58, in _setup
    "Please run `contrib/{}` instead.".format(name))
**NameError: Please run `contrib/MADDPG` instead.**
2019-12-14 17:57:46,468	INFO trial_runner.py:615 -- Attempting to recover trial state from last checkpoint.
(pid=12582) 2019-12-14 17:57:46,461	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 17:57:47,576	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(NameError): ray__SeeContrib:train() (pid=12576, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/__init__.py", line 58, in _setup
    "Please run `contrib/{}` instead.".format(name))
**NameError: Please run `contrib/MADDPG` instead.**
2019-12-14 17:57:47,579	INFO trial_runner.py:615 -- Attempting to recover trial state from last checkpoint.
(pid=12576) 2019-12-14 17:57:47,572	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 17:57:48,644	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(NameError): ray__SeeContrib:train() (pid=12578, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/__init__.py", line 58, in _setup
    "Please run `contrib/{}` instead.".format(name))
**NameError: Please run `contrib/MADDPG` instead.**
Traceback (most recent call last):
  File "run_maddpg.py", line 182, in <module>
    main(args)
  File "run_maddpg.py", line 177, in main
    }, verbose=0)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/tune.py", line 334, in run_experiments
    return_trials=True)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/tune.py", line 269, in run
    raise TuneError("Trials did not complete", errored_trials)
ray.tune.error.TuneError: ('Trials did not complete', [MADDPG_mpe_0])
(pid=12578) 2019-12-14 17:57:48,639	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution

@sanjeevanahilan
Copy link
Author

sanjeevanahilan commented Dec 14, 2019

Ahh sorry, you also need to change:

run_experiments({
        "MADDPG_RLLib": {
            "run": "contrib/MADDPG",
            },

I've updated the PR but can't test this right now unfortunately, so let me know if there are still problems. I was trying to help out with this issue: ray-project/ray#6476

@jkterry1
Copy link

I got to this PR from having the same error as in that bug actually. Thanks the help with this too. There are still errors with that fix:

justinkterry@Prophet:~/Documents/maddpg-rllib$ python3 run_maddpg.py 
2019-12-14 18:33:21,718	INFO resource_spec.py:205 -- Starting Ray with 38.43 GiB memory available for workers and up to 2.79 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).
2019-12-14 18:33:22,053	WARNING sample.py:31 -- DeprecationWarning: wrapping <function main.<locals>.<lambda> at 0x7fdeb389ad90> with tune.function() is no longer needed
2019-12-14 18:33:22,127	WARNING worker.py:348 -- WARNING: Falling back to serializing objects of type <class 'numpy.dtype'> by using pickle. This may be inefficient.
2019-12-14 18:33:22,136	WARNING worker.py:348 -- WARNING: Falling back to serializing objects of type <class 'mtrand.RandomState'> by using pickle. This may be inefficient.
(pid=14615) 2019-12-14 18:33:24,168	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 18:33:24,860	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray_MADDPG:train() (pid=14615, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 90, in __init__
    Trainer.__init__(self, config, env, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 492, in _setup
    self._init(self.config, self.env_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 109, in _init
    self.config["num_workers"])
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 537, in _make_workers
    logdir=self.logdir)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 64, in __init__
    RolloutWorker, env_creator, policy, 0, self._local_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 220, in _make_worker
    _fake_sampler=config.get("_fake_sampler", False))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 348, in __init__
    self._build_policy_map(policy_dict, policy_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 764, in _build_policy_map
    policy_map[name] = cls(obs_space, act_space, merged_conf)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 158, in __init__
    scope="actor"))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 368, in _build_actor_network
    sampler = tfp.distributions.RelaxedOneHotCategorical(
AttributeError: 'NoneType' object has no attribute 'distributions'
2019-12-14 18:33:24,865	INFO trial_runner.py:615 -- Attempting to recover trial state from last checkpoint.
(pid=14604) 2019-12-14 18:33:25,922	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 18:33:26,632	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray_MADDPG:train() (pid=14604, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 90, in __init__
    Trainer.__init__(self, config, env, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 492, in _setup
    self._init(self.config, self.env_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 109, in _init
    self.config["num_workers"])
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 537, in _make_workers
    logdir=self.logdir)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 64, in __init__
    RolloutWorker, env_creator, policy, 0, self._local_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 220, in _make_worker
    _fake_sampler=config.get("_fake_sampler", False))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 348, in __init__
    self._build_policy_map(policy_dict, policy_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 764, in _build_policy_map
    policy_map[name] = cls(obs_space, act_space, merged_conf)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 158, in __init__
    scope="actor"))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 368, in _build_actor_network
    sampler = tfp.distributions.RelaxedOneHotCategorical(
AttributeError: 'NoneType' object has no attribute 'distributions'
2019-12-14 18:33:26,637	INFO trial_runner.py:615 -- Attempting to recover trial state from last checkpoint.
(pid=14605) 2019-12-14 18:33:27,692	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 18:33:28,390	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray_MADDPG:train() (pid=14605, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 90, in __init__
    Trainer.__init__(self, config, env, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 492, in _setup
    self._init(self.config, self.env_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 109, in _init
    self.config["num_workers"])
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 537, in _make_workers
    logdir=self.logdir)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 64, in __init__
    RolloutWorker, env_creator, policy, 0, self._local_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 220, in _make_worker
    _fake_sampler=config.get("_fake_sampler", False))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 348, in __init__
    self._build_policy_map(policy_dict, policy_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 764, in _build_policy_map
    policy_map[name] = cls(obs_space, act_space, merged_conf)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 158, in __init__
    scope="actor"))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 368, in _build_actor_network
    sampler = tfp.distributions.RelaxedOneHotCategorical(
AttributeError: 'NoneType' object has no attribute 'distributions'
2019-12-14 18:33:28,394	INFO trial_runner.py:615 -- Attempting to recover trial state from last checkpoint.
(pid=14603) 2019-12-14 18:33:29,456	INFO trainer.py:345 -- Tip: set 'eager': true or the --eager flag to enable TensorFlow eager execution
2019-12-14 18:33:30,136	ERROR trial_runner.py:569 -- Error processing event.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trial_runner.py", line 515, in _process_trial
    result = self.trial_executor.fetch_result(trial)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/ray_trial_executor.py", line 351, in fetch_result
    result = ray.get(trial_future[0])
  File "/usr/local/lib/python3.7/dist-packages/ray/worker.py", line 2121, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray_MADDPG:train() (pid=14603, host=Prophet)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 90, in __init__
    Trainer.__init__(self, config, env, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 372, in __init__
    Trainable.__init__(self, config, logger_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/trainable.py", line 96, in __init__
    self._setup(copy.deepcopy(self.config))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 492, in _setup
    self._init(self.config, self.env_creator)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer_template.py", line 109, in _init
    self.config["num_workers"])
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/agents/trainer.py", line 537, in _make_workers
    logdir=self.logdir)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 64, in __init__
    RolloutWorker, env_creator, policy, 0, self._local_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/worker_set.py", line 220, in _make_worker
    _fake_sampler=config.get("_fake_sampler", False))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 348, in __init__
    self._build_policy_map(policy_dict, policy_config)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/evaluation/rollout_worker.py", line 764, in _build_policy_map
    policy_map[name] = cls(obs_space, act_space, merged_conf)
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 158, in __init__
    scope="actor"))
  File "/usr/local/lib/python3.7/dist-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 368, in _build_actor_network
    sampler = tfp.distributions.RelaxedOneHotCategorical(
AttributeError: 'NoneType' object has no attribute 'distributions'
Traceback (most recent call last):
  File "run_maddpg.py", line 182, in <module>
    main(args)
  File "run_maddpg.py", line 177, in main
    }, verbose=0)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/tune.py", line 334, in run_experiments
    return_trials=True)
  File "/usr/local/lib/python3.7/dist-packages/ray/tune/tune.py", line 269, in run
    raise TuneError("Trials did not complete", errored_trials)
ray.tune.error.TuneError: ('Trials did not complete', [contrib_MADDPG_mpe_0])

@sanjeevanahilan
Copy link
Author

tfp is Tensorflow Probability which I think you just need to pip install.

https://www.tensorflow.org/probability

Hopefully that works. Also, if you are able to benchmark this code it would be great. This project is unrelated to me, but in my brief tests I experienced some training issues when using Tensoflow 2.0.

@jkterry1
Copy link

Thank you. I'm using tensorflow v1.14 at the moment, because stable baselines is not compatible with tf2. I get the exact same error after installing tensorflow probability. Here's all my packages for reference:

justinkterry@Prophet:~/Documents/maddpg-rllib$ pip3 list
Package                 Version     Location                                     
----------------------- ----------- ---------------------------------------------
absl-py                 0.8.1       
altair                  3.2.0       
apturl                  0.5.2       
asn1crypto              0.24.0      
astor                   0.8.0       
atari-py                0.2.6       
attrs                   19.3.0      
backcall                0.1.0       
bleach                  3.1.0       
blinker                 1.4         
box2d-py                2.3.8       
Brlapi                  0.6.7       
certifi                 2019.9.11   
cffi                    1.12.3      
chardet                 3.0.4       
chrome-gnome-shell      0.0.0       
Click                   7.0         
cloudpickle             1.1.1       
colorama                0.4.3       
colour                  0.1.5       
command-not-found       0.3         
cryptography            2.3         
cupshelpers             1.0         
cycler                  0.10.0      
dash                    1.4.1       
dash-core-components    1.3.1       
dash-html-components    1.0.1       
dash-renderer           1.1.2       
dash-table              4.4.1       
decorator               4.4.0       
defer                   1.0.6       
defusedxml              0.6.0       
distro                  1.3.0       
distro-info             0.21ubuntu2 
entrypoints             0.3         
enum34                  1.1.6       
filelock                3.0.12      
flake8                  3.7.8       
Flask                   1.1.1       
Flask-Compress          1.4.0       
funcsigs                1.0.2       
future                  0.18.1      
gast                    0.2.2       
google-pasta            0.1.8       
GPy                     1.9.8       
grpcio                  1.24.3      
gym                     0.15.3      
h5py                    2.10.0      
httplib2                0.11.3      
idna                    2.8         
imageio                 2.5.0       
importlib-metadata      0.23        
ipykernel               5.1.2       
ipython                 7.8.0       
ipython-genutils        0.2.0       
ipywidgets              7.5.1       
itsdangerous            1.1.0       
jedi                    0.15.1      
Jinja2                  2.10.1      
joblib                  0.14.0      
jsonschema              3.1.1       
jupyter                 1.0.0       
jupyter-client          5.3.3       
jupyter-console         6.0.0       
jupyter-core            4.6.0       
Keras-Applications      1.0.8       
Keras-Preprocessing     1.1.0       
keyboard                0.13.4      
keyring                 17.1.1      
keyrings.alt            3.1.1       
kiwisolver              1.1.0       
language-selector       0.1         
launchpadlib            1.10.6      
lazr.restfulclient      0.14.2      
lazr.uri                1.0.3       
louis                   3.8.0       
lz4                     2.2.1       
macaroonbakery          1.2.1       
Markdown                3.1.1       
MarkupSafe              1.1.1       
matplotlib              3.1.1       
mccabe                  0.6.1       
mistune                 0.8.4       
mock                    3.0.5       
more-itertools          7.2.0       
mpi4py                  3.0.3       
multiagent              0.0.1       /home/justinkterry/Documents/maddpg-rllib/MPE
nbconvert               5.6.0       
nbformat                4.4.0       
netifaces               0.10.4      
networkx                2.3         
notebook                6.0.1       
numexpr                 2.7.0       
numpy                   1.16.2      
numpy-stl               2.10.1      
oauthlib                2.1.0       
olefile                 0.46        
opencv-python           4.1.1.26    
packaging               19.2        
pandas                  0.25.1      
pandocfilters           1.4.2       
paramz                  0.9.5       
parso                   0.5.1       
pexpect                 4.6.0       
pickleshare             0.7.5       
Pillow                  5.4.1       
Pillow-SIMD             6.0.0.post0 
pip                     18.1        
plotly                  4.2.0       
pluggy                  0.13.1      
prometheus-client       0.7.1       
prompt-toolkit          2.0.9       
protobuf                3.11.1      
psutil                  5.6.7       
psycopg2                2.8.3       
ptyprocess              0.6.0       
py                      1.8.0       
pycairo                 1.16.2      
pycodestyle             2.5.0       
pycparser               2.19        
pycrypto                2.6.1       
pycups                  1.9.73      
pyflakes                2.1.1       
pygame                  1.9.6       
pyglet                  1.3.2       
Pygments                2.4.2       
PyGObject               3.32.0      
PyJWT                   1.7.0       
pymacaroons             0.13.0      
pymunk                  5.5.0       
PyNaCl                  1.3.0       
pynput                  1.4.5       
pyparsing               2.4.2       
pyRFC3339               1.1         
pyrsistent              0.15.4      
pytest                  5.3.1       
python-apt              1.8.4       
python-dateutil         2.7.3       
python-debian           0.1.34      
python-utils            2.3.0       
python-xlib             0.25        
pytz                    2019.3      
PyWavelets              1.0.3       
pyxdg                   0.25        
PyYAML                  3.13        
pyzmq                   18.1.0      
qtconsole               4.5.5       
ray                     0.7.6       
redis                   3.3.11      
reportlab               3.5.18      
requests                2.22.0      
requests-unixsocket     0.1.5       
retrying                1.3.3       
scikit-image            0.15.0      
scikit-learn            0.21.3      
scipy                   1.2.1       
screen-resolution-extra 0.0.0       
seaborn                 0.9.0       
SecretStorage           2.3.1       
selenium                3.141.0     
Send2Trash              1.5.0       
setproctitle            1.1.10      
setuptools              41.4.0      
simplejson              3.16.0      
six                     1.12.0      
sklearn                 0.0         
stable-baselines        2.8.0       
system-service          0.3         
systemd-python          234         
tables                  3.5.2       
tensorboard             1.14.0      
tensorflow              1.14.0      
tensorflow-estimator    1.14.0      
tensorflow-probability  0.8.0       
termcolor               1.1.0       
terminado               0.8.2       
testpath                0.4.2       
toolz                   0.10.0      
torch                   1.2.0       
torchvision             0.4.0       
tornado                 6.0.3       
traitlets               4.3.3       
ubuntu-advantage-tools  19.2        
ubuntu-drivers-common   0.0.0       
ufw                     0.36        
unattended-upgrades     0.1         
urllib3                 1.25.6      
wadllib                 1.3.3       
wcwidth                 0.1.7       
webencodings            0.5.1       
Werkzeug                0.16.0      
wheel                   0.32.3      
widgetsnbextension      3.5.1       
wrapt                   1.11.2      
xkit                    0.0.0       
zipp                    0.6.0       

@dragon28
Copy link

@justinkterry have you try to install tensorflow-probability==0.7.0 which tensorflow-probability version 0.7.0?

@jkterry1
Copy link

jkterry1 commented Dec 29, 2019 via email

@dragon28

This comment has been minimized.

@jkterry1
Copy link

jkterry1 commented Jan 4, 2020

@dragon28 the real world com scenario isn't one of the currently supported MPE games (read ~line 34 of run_maddpg.py where it parses the --scenario arg).

In terms of the memory error, it's an issue with ray configuration instead of this code. You have to edit the config for how much ram workers, etc. can use in ray (google it). Ray infers defaults based on the system, so my 64GB RAM workstation can run it fine without changes, but my 16GB RAM laptop can't.

@jkterry1
Copy link

jkterry1 commented Jan 4, 2020

This default config on my workstation works, for reference:

2020-01-04 17:34:56,871 INFO resource_spec.py:216 -- Starting Ray with 39.06 GiB memory available for workers and up to 2.79 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>).

@jkterry1
Copy link

@dragon28

Hey, I'm having the exact same memory issue as you very reproducibly. There appears to be a leak in the number of workers? I'll update this when I figured out what's going on more exactly.

@jkterry1
Copy link

Hey all, this repo isn't being maintained, so I forked it, made these fixes, and the maintainers of RLlib/ray made it the new official example repo of the maddpg example code. See ray-project/ray#6831 and https://github.com/justinkterry/maddpg-rllib.

@aiguoth
Copy link

aiguoth commented Jun 4, 2020

hey, @justinkterry I got the same error as in that bug actually. Thanks the help with this too. There are still errors with that fix:

2020-06-04 15:16:12,567 ERROR trial_runner.py:519 -- Trial MADDPG_mpe_420fc_00000: Error processing event.
Traceback (most recent call last):
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/tune/trial_runner.py", line 467, in _process_trial
result = self.trial_executor.fetch_result(trial)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/tune/ray_trial_executor.py", line 430, in fetch_result
result = ray.get(trial_future[0], DEFAULT_GET_TIMEOUT)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/worker.py", line 1474, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(AttributeError): ray::MADDPG.train() (pid=148180, ip=192.168.1.106)
File "python/ray/_raylet.pyx", line 407, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 442, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 445, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 446, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 400, in ray._raylet.execute_task.function_executor
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 90, in init
Trainer.init(self, config, env, logger_creator)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 452, in init
super().init(config, logger_creator)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/tune/trainable.py", line 174, in init
self._setup(copy.deepcopy(self.config))
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 627, in _setup
self._init(self.config, self.env_creator)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/agents/trainer_template.py", line 115, in _init
self.config["num_workers"])
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/agents/trainer.py", line 700, in _make_workers
logdir=self.logdir)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/evaluation/worker_set.py", line 59, in init
RolloutWorker, env_creator, policy, 0, self._local_config)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/evaluation/worker_set.py", line 282, in _make_worker
extra_python_environs=extra_python_environs)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/evaluation/rollout_worker.py", line 378, in init
self._build_policy_map(policy_dict, policy_config)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/evaluation/rollout_worker.py", line 930, in _build_policy_map
policy_map[name] = cls(obs_space, act_space, merged_conf)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 155, in init
scope="actor"))
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/rllib/contrib/maddpg/maddpg_policy.py", line 371, in _build_actor_network
sampler = tfp.distributions.RelaxedOneHotCategorical(
AttributeError: 'NoneType' object has no attribute 'distributions'
Traceback (most recent call last):
File "run_maddpg.py", line 183, in
main(args)
File "run_maddpg.py", line 178, in main
}, verbose=0)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/tune/tune.py", line 411, in run_experiments
return_trials=True)
File "/home/aics/anaconda3/envs/tf/lib/python3.6/site-packages/ray/tune/tune.py", line 347, in run
raise TuneError("Trials did not complete", incomplete_trials)
ray.tune.error.TuneError: ('Trials did not complete', [MADDPG_mpe_420fc_00000])
(tf) aics@aics-Super-Server:~/RayRLlib/maddpg-rllib$

@jkterry1
Copy link

jkterry1 commented Jun 13, 2020 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

Successfully merging this pull request may close these issues.

None yet

4 participants