Skip to content

atari_wrappers.py: Input shape does not seem quite right #15

@pllee4

Description

@pllee4

Hi, isn't we need to stack first before invert? By inverting first, I believe the stacked axis is different than expected.

def make_env(env_name, fire=True):
env = gym.make(env_name)
env = MaxAndSkipEnv(env) ## Return only every `skip`-th frame
if fire:
env = FireResetEnv(env) ## Fire at the beginning
env = WarpFrame(env) ## Reshape image
env = ImageToPyTorch(env) ## Invert shape
env = FrameStack(env, 4) ## Stack last 4 frames
env = ScaledFloatFrame(env) ## Scale frames
return env

The current code would produce input shape of
(1, 84, 336)

If we change to

    env = WarpFrame(env) ## Reshape image
    env = FrameStack(env, 4) ## Stack last 4 frames
    env = ImageToPyTorch(env) ## Invert shape

then we would be able to get shape of

(4, 84, 84)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions