pycharm出现gym.error.DeprecatedEnv: Env Pendulum-v0 not found (valid versions include [‘Pendulum-v1‘])

问题

使用gym包的时候,遇到了下面这样的问题:找不到对应的版本。

 for external in metadata.entry_points().get(self.group, []):
Traceback (most recent call last):
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 158, in spec
    return self.env_specs[id]
KeyError: 'Pendulum-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/Papers/202111/tianshou-0.4.4/test/continuous/test_ppo.py", line 191, in <module>
    test_ppo()
  File "E:/Papers/202111/tianshou-0.4.4/test/continuous/test_ppo.py", line 58, in test_ppo
    env = gym.make(args.task)
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 235, in make
    return registry.make(id, **kwargs)
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 128, in make
    spec = self.spec(path)
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 187, in spec
    id, matching_envs
gym.error.DeprecatedEnv: Env Pendulum-v0 not found (valid versions include ['Pendulum-v1'])

Process finished with exit code 1

解决办法

之前跑‘CartPole-v0’的task是可以运行的,所以,说明我的gym没有问题。只要把Pendulum-v0改成Pendulum-v1就可以跑了(问题主要就是版本的问题)

你可能感兴趣的:(python,强化学习)