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.

[Feature] [RLLib] Remove RNNSAC

See original GitHub issue

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

RNNSAC is badly broken. I lost a lot of time trying to use it. It would be an improvement to RLLib to remove it as it is not maintained. And obviously no one has ever used it since there are no bug reports.

I found many bugs and I’m sure there are many more.

RNNSACTrainer.validate_config() modifies the input config["replay_sequence_length"]. But config validation is called twice in the grand scheme of things and it crashes the second time it’s called.

In rnn_torch_sac_policy.py:action_distribution_fn() calls model.get_q_values() (twice if twin_q) but without adding the final actions argument input_dict["actions"]. Somehow get_q_values() accepts a missing actions and uses None instead. But that crashed in my use case. I had to pass the actions within action_distribution_fn(), which are anyway available as input_dict["actions"].

RNNSACTorchModel._get_q_value() is called twice when twin_q is used. But the input argument model_out is modified by the function and it crashes the second time it’s called with a now modified model_out input.

Also I had to replace RNNSACTorchModel.get_policy_output() with SACTorchModel.get_policy_output(). The SAC version does a lot of preprocessing to the argument model_out which was certainly needed for my use case.

Something else which may be completely irrelevant is that ComplexInputNetwork.__init__() calls TorchModelV2.__init__(..., self.original_space, ...), but I changed it to obs_space instead of original_space. I honestly can’t remember why I did that; I’m not sure if I needed to change that to get RNNSAC working. But it might break RLLib elsewhere to do that. I’m just mentioning this so you can take a look and double check if the current TorchModelV2.__init__(..., self.original_space, ...) is correct.

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
max333commented, Apr 9, 2022

My state was multiple levels of dicts of dicts.

A slightly related bug I reported related to flattening a complex space: #22659.

0reactions
max333commented, Apr 24, 2022

No. You can close the issue. Thanks for fixing the other issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Models, Preprocessors, and Action Distributions — Ray 2.2.0
RLlib tries to pick one of its built-in preprocessors based on the environment's observation space. Thereby, the following simple rules apply: Discrete ...
Read more >
Installing Ray — Ray 2.2.0 - the Ray documentation
Clean removal of previous install pip uninstall -y ray # Install Ray with ... "ray-rllib" # installs Ray + dependencies for Ray RLlib...
Read more >
RNNSAC with continous action space - RLlib - Ray
Dear Ray-Team, I´m trying to use the rnnsac algorithm with a continuous action space environment. From ray.rllib.examples I took the ...
Read more >
ray.rllib.policy.policy — Ray 2.2.0 - the Ray documentation
Specific policies can override this function to provide custom list of view ... Args: auto_remove_unneeded_view_reqs: Whether to automatically remove those ...
Read more >
Building Ray from Source — Ray 2.2.0 - the Ray documentation
RLlib, Tune, Autoscaler, and most Python files do not require you to build ... Running the script will remove the ray/tune , ray/rllib...
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