问题
atri在新版的2.0 gym上atri-py已经分离到ale上,使用旧版api报错
The environment `SpaceInvaders` has been moved out of Gym to the package `ale-py`. Please install the package via `pip install ale-py`. You can instantiate the new namespaced environment as `ALE/SpaceInvaders`.
改使用ale,并使用ale-import-roms 导入ROMS和Atri 测试版本:
gym==0.23.1
ale-py==0.7.5
1 ale安装`
pip install ale-py
2 导入ROMS
下载Roms.rar,然后在win下面解压再拷贝回来ubuntu(#bug linux下解压Roms内存会无限增长,解压失败 ),主要导入atri的bin文件到ale_py的包下rom目录下。
ale-import-roms Roms/
gym中使用
代码中不建议使用render, 在初始化指定render_mode即可。
import gym
env = gym.make('ALE/SpaceInvaders-v5',
obs_type='rgb',
frameskip=4,
mode=None,
difficulty=None,
repeat_action_probability=0.25,
full_action_space=False,
render_mode='human'
)
env.reset()
for _ in range(10000):
a = env.action_space.sample()
s_prime, r, done, info = env.step(a)
|