Код: Выделить всё
# Import the game
import gym_super_mario_bros
# Import the Joypad wrapper
from nes_py.wrappers import JoypadSpace
# Import the SIMPLIFIED controls
from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
# Setup game
env = gym_super_mario_bros.make('SuperMarioBros-v0')
env = JoypadSpace(env, SIMPLE_MOVEMENT)
Код: Выделить всё
---------------------------------------------------------------------------
OverflowError Traceback (most recent call last)
Cell In[3], line 2
1 # Setup game
----> 2 env = gym_super_mario_bros.make('SuperMarioBros-v0')
3 env = JoypadSpace(env, SIMPLE_MOVEMENT)
File /Volumes/-/mario ai/mario/lib/python3.10/site-packages/gym/envs/registration.py:592, in make(id, max_episode_steps, autoreset, disable_env_checker, **kwargs)
588 else:
589 # Assume it's a string
590 env_creator = load(spec_.entry_point)
--> 592 env = env_creator(**_kwargs)
594 # Copies the environment creation specification and kwargs to add to the environment specification details
595 spec_ = copy.deepcopy(spec_)
File /Volumes/-/mario ai/mario/lib/python3.10/site-packages/gym_super_mario_bros/smb_env.py:52, in SuperMarioBrosEnv.__init__(self, rom_mode, lost_levels, target)
50 rom = rom_path(lost_levels, rom_mode)
51 # initialize the super object with the ROM path
---> 52 super(SuperMarioBrosEnv, self).__init__(rom)
53 # set the target world, stage, and area variables
54 target = decode_target(target, lost_levels)
File /Volumes/-/mario ai/mario/lib/python3.10/site-packages/nes_py/nes_env.py:126, in NESEnv.__init__(self, rom_path)
124 raise ValueError('ROM has trainer. trainer is not supported.')
125 # try to read the PRG ROM and raise a value error if it fails
--> 126 _ = rom.prg_rom
127 # try to read the CHR ROM and raise a value error if it fails
128 _ = rom.chr_rom
File /Volumes/-/mario ai/mario/lib/python3.10/site-packages/nes_py/_rom.py:204, in ROM.prg_rom(self)
202 """Return the PRG ROM of the ROM file."""
203 try:
--> 204 return self.raw_data[self.prg_rom_start:self.prg_rom_stop]
205 except IndexError:
206 raise ValueError('failed to read PRG-ROM on ROM.')
File /Volumes/-/mario ai/mario/lib/python3.10/site-packages/nes_py/_rom.py:198, in ROM.prg_rom_stop(self)
195 @property
196 def prg_rom_stop(self):
197 """The exclusive stopping index of the PRG ROM."""
--> 198 return self.prg_rom_start + self.prg_rom_size * 2**10
OverflowError: Python integer 1024 out of bounds for uint8
Подробнее здесь: https://stackoverflow.com/questions/787 ... on-on-jupy