Skip to content

[BUG] VecNorm.to_observation_norm broken for multiple keys #2036

@maxweissenbacher

Description

@maxweissenbacher

Describe the bug

The VecNorm transform produces a bug when calling the to_observation_norm method with multiple keys

To Reproduce

gym_env = GymEnv("MountainCarContinuous-v0", device='cpu')
transformed_env = TransformedEnv(gym_env, VecNorm(in_keys=["observation", "reward"]))
transformed_env.rollout(100)
transformed_env.transform[0].to_observation_norm()

Expected behavior

Should return ObservationNorm but gives following error:

...
out += ObservationNorm
TypeError: 'type' object is not iterable

Reason and Possible fixes

Using the VecNorm transform with only one key works - so to do it for multiple keys one can just use it repeatedly with single keys.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions