关于强化学习中gym版本导致的问题 AttributeError: ‘UnicycleEnv‘ object has no attribute ‘seed‘
·
在强化学习的环境创建中,由于跑的代码可能使用的是老版本 Gym(v0.19及以前)设置环境随机种子的方式,即
env.seed(args.seed)
但是由于setuptools 工具版本的原因,不能安装对应版本的gym或者是gym安装过程中与其他package发生冲突,对应的报错为:
AttributeError: 'UnicycleEnv' object has no attribute 'seed'
此时使用新版本的gym同时更改对应的代码为
env.reset()
np.random.seed(args.seed)
random.seed(args.seed)
解决这一问题。
更多推荐



所有评论(0)