AttributeError: 'LunarLander' object has no attribute 'seed'
时间: 2023-10-09 08:05:44 浏览: 475
Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
5星 · 资源好评率100%
AttributeError: 'LunarLander' object has no attribute 'seed'错误通常发生在使用Gym库的LunarLander环境时,想使用seed方法重置环境时。根据引用中提到的警告信息和引用中提到的DeprecationWarning,警告信息提到了`env.seed(seed)`方法已被标记为废弃,并在将来会被移除,建议使用`env.reset(seed=seed)`方法代替。
因此,解决这个错误的方法是将`env.seed(seed)`替换为`env.reset(seed=seed)`,这样就可以成功地重置LunarLander环境了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [python报错: list object has no attribute shape的解决](https://download.csdn.net/download/weixin_38748721/13708867)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [AttributeError:‘CartPoleEnv‘ object has no attribute ‘seed‘解决方案](https://blog.csdn.net/dream6985/article/details/126847399)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文