机器人找金币
问题:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tofugan/gym/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/home/tofugan/gym/gym/envs/registration.py", line 125, in make
patch_deprecated_methods(env)
File "/home/tofugan/gym/gym/envs/registration.py", line 185, in patch_deprecated_methods
env.seed = env._seed
AttributeError: 'GridEnv' object has no attribute '_seed'
问题分析:
在registration.py文件中找到如下代码:
env.reset = env._reset
env.step = env._step
env.seed = env._seed
对比其他的模型(如:CartPole-v0)我们发现书中的代码不存在seed函数。
解决方法:
1、注释掉(不推荐)