[rllib] rllib train in LOCAL_MODE fails
See original GitHub issueSystem information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04.4 LTS
- Ray installed from (source or binary): installed via pip
- Ray version: 0.5.0
- Python version: Python 3.5.2
- Exact command to reproduce: python3 train.py --run DQN --env CartPole-v0
Describe the problem
-
I use the existing ray/python/ray/rllib/train.py like this:
ray/python/ray/rllib$ python3 train.py --run DQN --env CartPole-v0
-
I make just one change to ray_init, hoping I could step through the code in local mode:
ray.init( … driver_mode=2 # 2=LOCAL_MODE )
Result: Exception.
Source code / logs
Traceback (most recent call last): File “train.py”, line 120, in <module> run(args, parser) File “train.py”, line 114, in run queue_trials=args.queue_trials) File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/tune/tune.py”, line 83, in run_experiments scheduler.add_experiment(experiment, runner) File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/tune/trial_scheduler.py”, line 62, in add_experiment trial_runner.add_trial(next(generator)) File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/tune/variant_generator.py”, line 75, in generate_trials max_failures=args.max_failures) File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/tune/trial.py”, line 97, in init if not has_trainable(trainable_name): File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/tune/trial.py”, line 61, in has_trainable ray.tune.registry.TRAINABLE_CLASS, trainable_name) File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/tune/registry.py”, line 83, in contains value = _internal_kv_get(_make_key(category, key)) File “/usr/local/CHUBBY/DYNAMIC/SRC/pathway/ray/python/ray/rllib/venv/lib/python3.5/site-packages/ray/experimental/internal_kv.py”, line 17, in _internal_kv_get return worker.redis_client.hget(key, “value”) AttributeError: ‘Worker’ object has no attribute ‘redis_client’
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
This is expected, since we use some features not available in local mode.
For stepping through code, you can create a DQN agent instance in Python and call agent.train() manually. I believe the default num_workers=0 so it will run all in one process without invoking Ray.
Yeah local mode now works.