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

[RLlib] Fix A3CTorchPolicy producing float metrics when not using critic #28236

Closed
RaymondKoopmanschap opened this issue Sep 1, 2022 · 0 comments
Labels
bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks rllib RLlib related issues

Comments

@RaymondKoopmanschap
Copy link

What happened + What you expected to happen

Basically similar bug as #27980 but then for A3C.
When I use A3C and I set use_critic = False (and use_gae = False) then I get the error

File "{path_to_ray}\ray\rllib\policy\torch_policy_v2.py", line 839, in <lambda>
    lambda s: s.to(self.device), tower.tower_stats[stats_name]
AttributeError: 'float' object has no attribute 'to'

After looking in the source code this makes sense to me and seems a bug.
In ray.rllib.algorithms.a3c.a3c_torch_policy.py line 101 the value_err gets assigned a value of 0.0 which is a float.
Then further along the code in ray.rllib.policy.torch_policy_v2.py line 839 the code
lambda s: s.to(self.device), tower.tower_stats[stats_name] tries to execute which then tries to use to(self.device) on a float which doesn't work.

Versions / Dependencies

Using

  • Windows
  • Ray 2.0.0
  • Python 3.9

Reproduction script

The reference to the bug #27980 should be enough I think. Let me know if a reproduction script is still needed.

Issue Severity

Low: It annoys or frustrates me.

@RaymondKoopmanschap RaymondKoopmanschap added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Sep 1, 2022
@richardliaw richardliaw added the rllib RLlib related issues label Oct 7, 2022
@kouroshHakha kouroshHakha added P1 Issue that should be fixed within a few weeks and removed triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't P1 Issue that should be fixed within a few weeks rllib RLlib related issues
Projects
None yet
Development

No branches or pull requests

3 participants