question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[rllib] rllib train in LOCAL_MODE fails

See original GitHub issue

System 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

  1. I use the existing ray/python/ray/rllib/train.py like this: ray/python/ray/rllib$ python3 train.py --run DQN --env CartPole-v0

  2. 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ericlcommented, Aug 23, 2018

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.

0reactions
ericlcommented, Sep 4, 2018

Yeah local mode now works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Qmix is not running when use gpu - RLlib - Ray
High: It blocks me to complete my task. QMIX this._loss is None qmix_policy.py. when set num_gpus > 0, the error is following: 2022-09-06 ......
Read more >
Starting Ray — Ray 2.2.0 - the Ray documentation
Calling ray.init() starts a local Ray instance on your laptop/machine. This laptop/machine becomes the “head node”. Note. In recent versions of Ray ...
Read more >
Getting Started with RLlib — Ray 2.2.0 - the Ray documentation
The rllib train command (same as the train.py script in the repo) has a number ... Maximum number of tf.function re-traces before a...
Read more >
Configuring Ray — Ray 2.2.0 - the Ray documentation
UNAVAILABLE details = "failed to connect to all addresses" ... code search path if you run a Java application in single machine mode...
Read more >
Source code for ray.rllib.evaluation.rollout_worker
This will silently fail for most OpenAI gyms # (they do nothing and return None per default) if not hasattr(env, "seed"): logger.info("Env doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found