[BUG] RenameTransform
of ParallelEnv
is not the same as ParallelEnv
of transformed environment
#2445
Open
3 tasks done
Labels
bug
Something isn't working
Describe the bug
In short:
transform(ParallelEnv(base_env)) != ParallelEnv(transform(base_env))
I'm aware that this is not supported in some cases, but I'd expect that this would work for the
RenameTransform
.This is even stated in the documentation: "There are two equivalent ways of transforming parallen environments: in each process separately, or on the main process. It is even possible to do both."
To Reproduce
Simple script to reproduce the issue:
Expected behavior
The script above should run without errors.
System info
Ubuntu 22.04
Python 3.10.14
torch 2.4.1
torchrl 0.5.0
Reason and Possible fixes
I've tracked down the issue to the
_set_properties
in theBatchedEnvBase
class. When writing to theself.done_spec
property, theEnvBase.done_spec
setter does not respect the renamed keys.Here's a comparison of the
full_done_spec
before and after calling thedone_spec
setter:The correct spec should be:
Checklist
The text was updated successfully, but these errors were encountered: