rlworkgroup / garage

A toolkit for reproducible reinforcement learning research.
MIT License
1.84k stars 309 forks source link

Send env[0]() or env[0]().spec as argument to augment_env_spec? #2262

Open Shushman opened 3 years ago

Shushman commented 3 years ago

https://github.com/rlworkgroup/garage/blob/f056fb8f6226c83d340c869e0d5312d61acf07f0/src/garage/examples/torch/pearl_metaworld_ml10.py#L104

Looking at the definition of PEARL.augment_env_spec, its first argument should be of type EnvSpec.

Then in the example script of torch-pearl, in the line I've referenced above, shouldn't the argument be env[0]().spec rather than env[0]()?

Shushman commented 3 years ago

And similarly for https://github.com/rlworkgroup/garage/blob/f056fb8f6226c83d340c869e0d5312d61acf07f0/src/garage/examples/torch/pearl_metaworld_ml10.py#L108

krzentner commented 3 years ago

In general, an environment can usually be passed into most places that expect and EnvSpec, since the common fields (observation_space, action_space, and max_episode_length) are the same. However, those scripts should technically pass env[0]().spec, yes.