Skip to content

[Question] Too many values to unpack issue #3299

@sohv

Description

@sohv

Hey,
I wrote the below code to initialize an instance of SpaceInvaders environment, run 1000 iterations to perform a random action from the sample space and render the environment in real-time.
import gym
env = gym.make("ALE/SpaceInvaders-v5")
env.reset()
for _ in range(1000):
env.step(env.action_space.sample())
env.render()
env.close()
But, I am encountering an error on env.step line that states ' ValueError: too many values to unpack (expected 4)'. I tried modifying that line to return 4 values and also downgraded gym version to check if it's working but to no use. Can you help me resolve this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions