如何解决开放式健身房的环境错误?

时间:2018-02-19 07:45:06

标签: python-3.x macos openai-gym

我正在使用健身房版本 - '0.9.7',以及安装在Mac上的mujoco_py版本1.50.1.41,Python 3.6.1 | Anaconda 4.4.0。

尝试时:

import gym
env = gym.make('Humanoid-v1')

我收到以下错误:

Traceback (most recent call last):
  File "/Users/usr/gym/gym/envs/registration.py", line 139, in spec
    return self.env_specs[id]
KeyError: 'Humanoid-v1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/usr/gym/gym/envs/registration.py", line 163, in make
    return registry.make(id)
  File "/Users/usr/gym/gym/envs/registration.py", line 118, in make
    spec = self.spec(id)
  File "/Users/usr/gym/gym/envs/registration.py", line 147, in spec
    raise error.DeprecatedEnv('Env {} not found (valid versions include {})'.format(id, matching_envs))
gym.error.DeprecatedEnv: Env Humanoid-v1 not found (valid versions include ['Humanoid-v2'])

我尝试在线寻找解决方案但没有成功。

1 个答案:

答案 0 :(得分:0)

gym's front page上的更改日志提及以下内容:

  

2018-01-24:所有连续控制环境现在都使用mujoco_py&gt; = 1.50。版本已相应更新为-v2,例如HalfCheetah-V2。性能应该相似(参见https://github.com/openai/gym/pull/834),但由于MuJoCo的变化,可能存在一些差异。

因此,如果您使用该日期或之后的健身房版本,则必须使用

env = gym.make('Humanoid-v2')

而不是v1。如果你真的特别想要版本1(例如在那个版本上复制以前的实验),看起来你必须安装旧版本的健身房和mujoco。