适合初学者的强化学习教程(1):python使⽤gym实践和注意
事项
作者:知乎
安装步骤和报错问题
1. 安装pip install gym
2. 报错 AttributeError: module 'vs.box2d' has no attribute 'BipedalWalker'
这是因为gym没有安ox2d的原因。
pip install box2d-py
如果上⾯这条命令出下⾯这个报错:
error: command ‘’ failed: No such file or directory
那就是swig这个软件没装,如果是装了anoconda的话输⼊命令conda install -c anaconda swig。⽤pip应该也有相应⽅法装
swig。
列出gym可以⽤的所有可以⽤的模型和模拟环境:
from gym import envs
istry.all())
下⾯是我根据程序跑出来的gym make()的模拟的环境名(参数名)列表
(Acrobot-v1),
(AirRaid-ram-v0),
(AirRaid-ram-v4),
(AirRaid-ramDeterministic-v0),
(AirRaid-ramDeterministic-v4),
(AirRaid-ramNoFrameskip-v0),
(AirRaid-ramNoFrameskip-v4),
(AirRaid-v0),
(AirRaid-v4),
(AirRaidDeterministic-v0),
(AirRaidDeterministic-v4),
(AirRaidNoFrameskip-v0),
(AirRaidNoFrameskip-v4),2d飞机
(Alien-ram-v0),
(Alien-ram-v4),
(Alien-ramDeterministic-v0),
(Alien-ramDeterministic-v4),
(Alien-ramNoFrameskip-v0), 2d迷宫⼩游戏
(Alien-ramNoFrameskip-v4),
(Alien-v0),⼩游戏迷宫打怪
(Alien-v4),
(AlienDeterministic-v0),
(AlienDeterministic-v4),
(AlienNoFrameskip-v0),
(AlienNoFrameskip-v4),
(Amidar-ram-v0), 、
(Amidar-ram-v4),
(Amidar-ramDeterministic-v0),
(Amidar-ramDeterministic-v4), ⼩游戏迷宫打怪
(Amidar-ramNoFrameskip-v0),
(Amidar-ramNoFrameskip-v4), ⼩游戏迷宫打怪
(Amidar-v0),
(Amidar-v4),
(AmidarDeterministic-v0),
(AmidarDeterministic-v4),⼩游戏迷宫
(AmidarNoFrameskip-v0),
(AmidarNoFrameskip-v4), 2d迷宫
(Ant-v2),
(Assault-ram-v0), 2d飞⾏⼩游戏
(Assault-ram-v4),
(Assault-ramDeterministic-v0), ⼩游戏2d飞⾏打怪
(Assault-ramDeterministic-v4),
(Assault-ramNoFrameskip-v0),
(Assault-ramNoFrameskip-v4), ⼩游戏打怪(Assault-v0),
(Assault-v4),
(AssaultDeterministic-v0), (AssaultDeterministic-v4), (AssaultNoFrameskip-v0), (AssaultNoFrameskip-v4),
(Asterix-ram-v0),
(Asterix-ram-v4),
(Asterix-ramDeterministic-v0),
(Asterix-ramDeterministic-v4),⼩游戏飞⾏打怪(Asterix-ramNoFrameskip-v0),
(Asterix-ramNoFrameskip-v4),
(Asterix-v0),
(Asterix-v4),
(AsterixDeterministic-v0), (AsterixDeterministic-v4), (AsterixNoFrameskip-v0), (AsterixNoFrameskip-v4),
(Asteroids-ram-v0),
(Asteroids-ram-v4), ⼩游戏
(Asteroids-ramDeterministic-v0), (Asteroids-ramDeterministic-v4), ⼩游戏打怪(Asteroids-ramNoFrameskip-v0), (Asteroids-ramNoFrameskip-v4), (Asteroids-v0),
(Asteroids-v4), (AsteroidsDeterministic-v0), (AsteroidsDeterministic-v4), (AsteroidsNoFrameskip-v0), (AsteroidsNoFrameskip-v4),
(Atlantis-ram-v0),
(Atlantis-ram-v4),
(Atlantis-ramDeterministic-v0), 打⽔怪(Atlantis-ramDeterministic-v4),
(Atlantis-ramNoFrameskip-v0),⼩游戏打⽔怪(Atlantis-ramNoFrameskip-v4),
(Atlantis-v0),
(Atlantis-v4),
(AtlantisDeterministic-v0),飞⾏打怪⼩游戏(AtlantisDeterministic-v4), 2D飞机打⽔怪(AtlantisNoFrameskip-v0), (AtlantisNoFrameskip-v4),
(BankHeist-ram-v0),
(BankHeist-ram-v4),
(BankHeist-ramDeterministic-v0), 2d迷宫(BankHeist-ramDeterministic-v4), (BankHeist-ramNoFrameskip-v0), (BankHeist-ramNoFrameskip-v4), (BankHeist-v0),
(BankHeist-v4), (BankHeistDeterministic-v0), (BankHeistDeterministic-v4), (BankHeistNoFrameskip-
v0), (BankHeistNoFrameskip-v4), (BattleZone-ram-v0),
(BattleZone-ram-v4),
(BattleZone-ramDeterministic-v0), (BattleZone-ramDeterministic-v4), (BattleZone-ramNoFrameskip-v0), (BattleZone-ramNoFrameskip-v4), 2D坦克(BattleZone-v0),
(BattleZone-v4), (BattleZoneDeterministic-v0), 坦克⼩游戏(BattleZoneDeterministic-v4), (BattleZoneNoFrameskip-v0), (BattleZoneNoFrameskip-v4),
(BeamRider-ram-v0),
(BeamRider-ram-v4),
(BeamRider-ramDeterministic-v0), (BeamRider-ramDeterministic-v4), (BeamRider-ramNoFrameskip-v0), (BeamRider-ramNoFrameskip-v4), (BeamRider-v0),
(BeamRider-v4), (BeamRiderDeterministic-v0), (BeamRiderDeterministic-v4), ⼩游戏2d飞⾏打怪(BeamRiderNoFrameskip-v0), (BeamRiderNoFrameskip-v4),
(Berzerk-ram-v0),
(Berzerk-ram-v4),
(Berzerk-ramDeterministic-v0),⼩游戏迷宫打怪(Berzerk-ramDeterministic-v4), ⼩游戏迷宫打怪(Berzerk-ramNoFrameskip-v0),
(Berzerk-ramNoFrameskip-v4),
(Berzerk-v0),
(Berzerk-v4),
(BerzerkDeterministic-v0), 2d迷宫(BerzerkDeterministic-v4), 2d飞⾏⼩游戏(BerzerkNoFrameskip-v0), (BerzerkNoFrameskip-v4), ⼩游戏迷宫打怪(BipedalWalker-v2), (BipedalWalkerHardcore-v2),
(Blackjack-v0), 错误
(Bowling-ram-v0),
(Bowling-ram-v4), 弹球类⼩游戏
(Bowling-ramDeterministic-v0),
(Bowling-ramDeterministic-v4),
(Bowling-ramNoFrameskip-v0),
(Bowling-ramNoFrameskip-v4),
(Bowling-v0),
(Bowling-v4), ⼩游戏弹球(BowlingDeterministic-v0), (BowlingDeterministic-v4), (BowlingNoFrameskip-v0), (BowlingNoFrameskip-v4),
(Boxing-ram-v0),
(Boxing-ram-v4),
(Boxing-ramDeterministic-v0),⼩游戏博弈(Boxing-ramDeterministic-v4),
(Boxing-ramNoFrameskip-v0),
(Boxing-ramNoFrameskip-v4),
(Boxing-v0), ⼩游戏博弈
(Boxing-v4),
(BoxingDeterministic-v0), (BoxingDeterministic-v4), ⼩游戏博弈(BoxingNoFrameskip-v0), (BoxingNoFrameskip-v4),
(Breakout-ram-v0), 乒乓球
(Breakout-ram-v4),
(Breakout-ramDeterministic-v0),
(Breakout-ramDeterministic-v4), ⼩游戏乒乓球(Breakout-ramNoFrameskip-v0),
(Breakout-ramNoFrameskip-v4),
(Breakout-v0),
(Breakout-v4), ⼩游戏打乒乓球(BreakoutDeterministic-v0), (BreakoutDeterministic-v4), (BreakoutNoFrameskip-v0), (BreakoutNoFrameskip-v4), (CNNClassifierTraining-v0),
(CarRacing-v0),
(Carnival-ram-v0), 2d飞机打怪
(Carnival-ram-v4),
(Carnival-ramDeterministic-v0),
(Carnival-ramDeterministic-v4),
(Carnival-ramNoFrameskip-v0), ⼩游戏2d飞⾏打怪(Carnival-ramNoFrameskip-v4),
(Carnival-v0),
(Carnival-v4),
(CarnivalDeterministic-v0),
(CarnivalDeterministic-v4),
(CarnivalNoFrameskip-v0),
(CarnivalNoFrameskip-v4),
(CartPole-v0),
(CartPole-v1),
(Centipede-ram-v0),
(Centipede-ram-v4),
(Centipede-ramDeterministic-v0),
(Centipede-ramDeterministic-v4),
(Centipede-ramNoFrameskip-v0),
(Centipede-ramNoFrameskip-v4),
(Centipede-v0), ⼩游戏弹球打怪
(Centipede-v4),
(CentipedeDeterministic-v0), (CentipedeDeterministic-v4), (CentipedeNoFrameskip-v0), (CentipedeNoFrameskip-v4),
(ChopperCommand-ram-v0),
(ChopperCommand-ram-v4),⼩游戏打怪(ChopperCommand-ramDeterministic-v0), (ChopperCommand-ramDeterministic-v4), (ChopperCommand-ramNoFrameskip-v0), (ChopperCommand-ramNoFrameskip-v4),⼩游戏打怪(ChopperCommand-v0),
(ChopperCommand-v4), (ChopperCommandDeterministic-v0), ⼩游戏两边射出⼦弹打怪(ChopperCommandDeterministic-v4), (ChopperCommandNoFrameskip-v0), (ChopperCommandNoFrameskip-v4),
(CliffWalking-v0),
(ConvergenceControl-v0),
(Copy-v0),
(CrazyClimber-ram-v0),
(CrazyClimber-ram-v4),
(CrazyClimber-ramDeterministic-v0),
(CrazyClimber-ramDeterministic-v4),
(CrazyClimber-ramNoFrameskip-v0),
(CrazyClimber-ramNoFrameskip-v4),
(CrazyClimber-v0), ⼩游戏2d攀爬
(CrazyClimber-v4),
(CrazyClimberDeterministic-v0), (CrazyClimberDeterministic-v4), (CrazyClimberNoFrameskip-v0), (CrazyClimberNoFrameskip-v4),
(DemonAttack-ram-v0),
(DemonAttack-ram-v4),
(DemonAttack-ramDeterministic-v0),
(DemonAttack-ramDeterministic-v4),
(DemonAttack-ramNoFrameskip-v0),
(DemonAttack-ramNoFrameskip-v4),
(DemonAttack-v0),
(DemonAttack-v4),
(DemonAttackDeterministic-v0), (DemonAttackDeterministic-v4), (DemonAttackNoFrameskip-v0), (DemonAttackNoFrameskip-v4),
(DoubleDunk-ram-v0),
(DoubleDunk-ram-v4),
(DoubleDunk-ramDeterministic-v0),
(DoubleDunk-ramDeterministic-v4),
(DoubleDunk-ramNoFrameskip-v0),
(DoubleDunk-ramNoFrameskip-v4),
(DoubleDunk-v0),
(DoubleDunk-v4), (DoubleDunkDeterministic-v0), (DoubleDunkDeterministic-v4), (DoubleDunkNoFrameskip-v0), (DoubleDunkNoFrameskip-v4), 投篮⼩游戏(DuplicatedInput-v0), (ElevatorAction-ram-v0), (ElevatorAction-ram-v4), (ElevatorAction-ramDeterministic-v0), (ElevatorAction-ramDeterministic-v4), (ElevatorAction-ramNoFrameskip-v0), (ElevatorAction-ramNoFrameskip-v4), (ElevatorAction-v0),
(ElevatorAction-v4), (ElevatorActionDeterministic-v0), (ElevatorActionDeterministic-v4), (ElevatorActionNoFrameskip-v0), (ElevatorActionNoFrameskip-v4), (Enduro-ram-v0),
(Enduro-ram-v4),
(Enduro-ramDeterministic-v0), ⼩游戏赛车(Enduro-ramDeterministic-v4),
python新手适合的软件(Enduro-ramNoFrameskip-v0), (Enduro-ramNoFrameskip-v4), (Enduro-v0),
(Enduro-v4), 2d赛车(EnduroDeterministic-v0), (EnduroDeterministic-v4), (EnduroNoFrameskip-v0), (EnduroNoFrameskip-v4), (FishingDerby-ram-v0), (FishingDerby-ram-v4), (FishingDerby-ramDeterministic-v0), (FishingDerby-ramDeterministic-v4), (FishingDerby-ramNoFrameskip-v0), (FishingDerby-ramNoFrameskip-v4), (FishingDerby-v0),⼩游戏钓鱼(FishingDerby-v4), (FishingDerby
Deterministic-v0), (FishingDerbyDeterministic-v4), (FishingDerbyNoFrameskip-v0), (FishingDerbyNoFrameskip-v4), (Freeway-ram-v0),
(Freeway-ram-v4),
(Freeway-ramDeterministic-v0), (Freeway-ramDeterministic-v4), (Freeway-ramNoFrameskip-v0), (Freeway-ramNoFrameskip-v4), (Freeway-v0),
(Freeway-v4), (FreewayDeterministic-v0), (FreewayDeterministic-v4), (FreewayNoFrameskip-v0), (FreewayNoFrameskip-v4),
(Frostbite-ram-v0), ⼩游戏类似跳⽔(Frostbite-ram-v4),⼩游戏类似跳⽔(Frostbite-ramDeterministic-v0), (Frostbite-ramDeterministic-v4), (Frostbite-ramNoFrameskip-v0), (Frostbite-ramNoFrameskip-v4), (Frostbite-v0),
(Frostbite-v4), (FrostbiteDeterministic-v0), (FrostbiteDeterministic-v4), (FrostbiteNoFrameskip-v0), ⼩游戏(FrostbiteNoFrameskip-v4), (FrozenLake-v0),

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。