报错显示:
We're Unable to find the game "MsPacman". Note: Gym no longer distributes ROMs. If you own a license to use the necessary ROMs for research purposes you can download them via `pip install gym[accept-rom-license]`. Otherwise, you should try importing "MsPacman" via the command `ale-import-roms`. If you believe this is a mistake perhaps your copy of "MsPacman" is unsupported. To check if this is the case try providing the environment variable `PYTHONWARNINGS=default::ImportWarning:ale_py.roms`. For more information see: https://github.com/mgbellemare/Arcade-Learning-Environment#rom-management
解决方法:
在综合搜索之后,发现可行组合。值得一试
1.安装指定版本的gym和altari-py
pip install gym==0.19.0 pip install atari_py==0.2.6
?2.安装rom
官方参考:
https://github.com/openai/atari-py#roms
中文参考:
Exception: ROM is missing for ms_pacman, see https://github.com/openai/atari-py#roms for instruction_CSU_FuChou的博客-CSDN博客
测试代码:
import gym
#更换为所需的环境
env = gym.make("MsPacman-v0")
print(env.action_space.n)
env.render()
env.close()
|