gpt4 book ai didi

python-3.x - 如何解决 OpenAI Gym 中的 "Env not found"错误?

转载 作者:行者123 更新时间:2023-12-03 23:17:06 27 4
gpt4 key购买 nike

我正在使用安装在 Mac 上的健身房版本 - '0.9.7' 和 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'])

我曾尝试在网上寻找解决方案,但没有成功。

最佳答案

更新日志 gym's front page提到以下内容:

2018-01-24: All continuous control environments now use mujoco_py >= 1.50. Versions have been updated accordingly to -v2, e.g. HalfCheetah-v2. Performance should be similar (see https://github.com/openai/gym/pull/834) but there are likely some differences due to changes in MuJoCo.



因此,如果您使用的是该日期或之后的健身房版本,则必须使用
env = gym.make('Humanoid-v2')

而不是 v1 .如果您真的特别想要版本 1(例如,用于在该版本上重现以前的实验),那么您似乎必须安装旧版本的健身房和 mujoco。

关于python-3.x - 如何解决 OpenAI Gym 中的 "Env not found"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48861523/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com