from tensorflow.keras.models import Sequential中keras报错
时间: 2024-01-03 17:39:37 浏览: 137
如果在使用from tensorflow.keras.models import Sequential时出现了keras报错,可以尝试使用tensorflow.keras来导入。具体代码修改为from tensorflow.keras import Sequential。这样可以解决module 'tensorflow' has no attribute 'get_default_graph'的报错。\[1\]
#### 引用[.reference_title]
- *1* [keras.models导入Sequential错误](https://blog.csdn.net/weixin_43582101/article/details/117079573)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [安装了tensorflow导入keras报错](https://blog.csdn.net/xiaofeixia002X/article/details/128196908)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [生成对抗网络 图像生成_用生成对抗网络在10分钟内生成图像](https://blog.csdn.net/weixin_26715991/article/details/108958622)[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^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文