我正在尝试遵循 Nicholas Renotte 教程的“使用 Python 构建马里奥 AI 模型 | 游戏强化学习”,但由于出现一些错误而无法继续。
这是我的代码:
!pip install gym_super_mario_bros==7.3.0 nes_py
# 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)
Run Code Online (Sandbox Code Playgroud)
这行代码: env = gym_super_mario_bros.make('SuperMarioBros-v0')导致以下错误:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_16900\3897944130.py in <module>
1 # Setup game
----> 2 env = gym_super_mario_bros.make('SuperMarioBros-v0')
3 env = JoypadSpace(env, SIMPLE_MOVEMENT)
D:\Anaconda\envs\gamesAi\lib\site-packages\gym\envs\registration.py in …Run Code Online (Sandbox Code Playgroud) python artificial-intelligence reinforcement-learning jupyter-notebook openai-gym