Extract episode return in ProcgenEnv
KarlXing opened this issue · 2 comments
Hi, I noticed that there's episode return information when I run procgen interactively. For example,
python -m procgen.interactive --env-name coinrun
first=0 steps=15 episode_steps=15 episode_return_delta=0.0 episode_return=0.0
first=0 steps=30 episode_steps=30 episode_return_delta=0.0 episode_return=0.0
first=0 steps=45 episode_steps=45 episode_return_delta=0.0 episode_return=0.0
first=0 steps=60 episode_steps=60 episode_return_delta=0.0 episode_return=0.0
first=0 steps=75 episode_steps=75 episode_return_delta=0.0 episode_return=0.0
first=0 steps=90 episode_steps=90 episode_return_delta=0.0 episode_return=0.0
first=0 steps=105 episode_steps=105 episode_return_delta=0.0 episode_return=0.0
first=0 steps=120 episode_steps=120 episode_return_delta=0.0 episode_return=0.0
first=0 steps=135 episode_steps=135 episode_return_delta=0.0 episode_return=0.0
first=1 steps=142 episode_steps=142 episode_return_delta=0.0 episode_return=0.0
final info={'episode_steps': 142, 'episode_return': 0.0, 'prev_level_seed': 1767567795, 'prev_level_complete': 0, 'level_seed': 863706747}
However, there is no such information when calling ProcgenEnv.step(action). The returned info dict only has information like below
{'prev_level_seed': 370, 'prev_level_complete': 0, 'level_seed': 370}
Is there a way to get information such as episode_return in ProcgenEnv step function?
Not directly, the interactive script just happens to keep track of that information: https://github.com/openai/gym3/blob/master/gym3/interactive.py#L72
Got it. Thanks!