'tensorflow.python.keras.optimizers' has no attribute 'SGD'
时间: 2023-09-07 13:16:50 浏览: 234
根据引用,您使用的是Tensorflow 2.6版本,而在该版本中,优化器的调用方式发生了改变。由于您遇到了一个名为'keras.optimizers' has no attribute 'RMSprop'的错误,根据引用,这是因为在最新版本的Tensorflow中,不再使用'keras.optimizers.RMSprop'来调用RMSprop优化器。相反,您应该使用'tensorflow.python.keras.optimizers.RMSprop'来调用RMSprop优化器。同样,根据引用,如果您遇到'tensorflow.python.keras.optimizers' has no attribute 'SGD'的错误,您应该将'keras.optimizers.SGD'更改为'tensorflow.python.keras.optimizers.SGD'。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [解决 AttributeError: module ‘keras.optimizers‘ has no attribute ‘RMSprop‘ 和‘Adam‘ 报错问题](https://blog.csdn.net/m0_51816252/article/details/126714517)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [python中module ‘keras.optimizers‘ has no attribute ‘Adam‘错误](https://blog.csdn.net/qq_32931827/article/details/122909624)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文