from nespy.wrappers import JoypadSpace import gymsupermariobros from…
- User
from nes_py.wrappers import JoypadSpace import gym_super_mario_bros from gym_super_mario_bros.actions import SIMPLE_MOVEMENT env = gym_super_mario_bros.make('SuperMarioBros-v0') env = JoypadSpace(env, SIMPLE_MOVEMENT)
done = True for step in range(5000): if done: state = env.reset() state, reward, done, info = env.step(env.action_space.sample()) env.render()
env.close() : python app.py C:\Users\yassir\miniconda3\Lib\site-packages\gym\envs\registration.py:555: UserWarning: WARN: The environment SuperMarioBros-v0 is out of date. You should consider upgrading to version
v3. logger.warn( C:\Users\yassir\miniconda3\Lib\site-packages\gym\utils\passive_env_checker.py:195: UserWarning: WARN: The result returned byenv.reset()was not a tuple of the form(obs, info), whereobsis a observation andinfois a dictionary containing additional information. Actual type:<class 'numpy.ndarray'>logger.warn( C:\Users\yassir\miniconda3\Lib\site-packages\gym\utils\passive_env_checker.py:219: DeprecationWarning: WARN: Core environment is written in old step API which returns one bool instead of two. It is recommended to rewrite the environment with new step API. logger.deprecation( C:\Users\yassir\miniconda3\Lib\site-packages\gym\utils\passive_env_checker.py:225: DeprecationWarning:np.bool8is a deprecated alias fornp.bool_. (Deprecated NumPy 1.24) if not isinstance(done, (bool, np.bool8)): Traceback (most recent call last): File "C:\Users\yassir\Desktop\mario\app.py", line 11, in state, reward, done, info = env.step(env.action_space.sample()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yassir\miniconda3\Lib\site-packages\nes_py\wrappers\joypad_space.py", line 74, in step return self.env.step(self._action_map[action]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yassir\miniconda3\Lib\site-packages\gym\wrappers\time_limit.py", line 50, in step observation, reward, terminated, truncated, info = self.env.step(action) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 5, got 4) - Assistant