开启AI健身房玩家模式

问题描述 投票:0回答:3

有谁知道如何作为玩家运行 OpenAI 健身房环境之一。就像让人类玩家玩一轮车竿一样?我已经看到有 env.mode = ' human' 但我无法让它正常运行。我尝试按照此处给出的示例进行操作https://www.pinchofintelligence.com/getting-started-openai-gym/但它似乎对我不起作用。

您能提供的任何帮助将不胜感激。

谢谢

python machine-learning reinforcement-learning openai-gym openair
3个回答
5
投票

我今天正在尝试这个,希望这有帮助:

env = gym.make('Breakout-v0')
gym.utils.play.play(env, zoom=3)

4
投票

我找到了如何为环境启用播放模式。

https://github.com/openai/gym/blob/master/gym/utils/play.py


0
投票

openai/gym 存储库已移至 gymnasium 存储库。

PROMPT> pip install "gymnasium[atari, accept-rom-license]"

为了以可玩模式启动游戏。以交互模式启动 python,如下所示:

PROMPT> python

然后逐行粘贴以下内容:

import gymnasium as gym
from gymnasium.utils.play import play
env = gym.make('ALE/Breakout-v5', render_mode='rgb_array')
play(env, zoom=3)

键盘映射

  • a
    向左移动。
  • d
    向右移动。
  • 钥匙
    space
    是火。

退出游戏

exit()

更多信息请参见体育馆

Breakout
页面: https://gymnasium.farama.org/environments/atari/breakout/

并非所有环境都支持

render_mode="rgb_array"
并且可能无法启动。

© www.soinside.com 2019 - 2024. All rights reserved.