Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: not enough values to unpack (expected 5, got 4) #4

Open
Bassel1000 opened this issue May 15, 2023 · 1 comment
Open

ValueError: not enough values to unpack (expected 5, got 4) #4

Bassel1000 opened this issue May 15, 2023 · 1 comment

Comments

@Bassel1000
Copy link


ValueError Traceback (most recent call last)
Cell In[4], line 10
8 env.reset()
9 # Do random actions
---> 10 state, reward, done, info = env.step(env.action_space.sample())
11 # Show the game on the screen
12 env.render()

File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\nes_py\wrappers\joypad_space.py:74, in JoypadSpace.step(self, action)
59 """
60 Take a step using the given action.
61
(...)
71
72 """
73 # take the step and record the output
---> 74 return self.env.step(self._action_map[action])

File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gym\wrappers\time_limit.py:50, in TimeLimit.step(self, action)
39 def step(self, action):
40 """Steps through the environment and if the number of steps elapsed exceeds max_episode_steps then truncate.
41
42 Args:
(...)
...
---> 50 observation, reward, terminated, truncated, info = self.env.step(action)
51 self._elapsed_steps += 1
53 if self._elapsed_steps >= self._max_episode_steps:

ValueError: not enough values to unpack (expected 5, got 4)
I get this error while trying to run, how can I fix it?

@praty5
Copy link

praty5 commented May 24, 2023

env = gym_super_mario_bros.make('SuperMarioBros-v0', apply_api_compatibility=True, render_mode="human")
env = JoypadSpace(env, SIMPLE_MOVEMENT)
done = True
for step in range(100000):
# Start the game to begin with
if done:
env.reset()
observation, reward, terminated, truncated, info = env.step(env.action_space.sample())
done = terminated or truncated
env.render()
env.close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants