module 'numpy' has no attribute 'losses'
时间: 2023-08-28 10:07:28 浏览: 89
回答:
对于第一个问题,报错 "AttributeError: module 'tensorflow.keras.backend' has no attribute 'get_session'" 的原因是在最新版本的 TensorFlow 中, 'get_session' 方法已经被弃用了。解决这个问题的方法有两种,一种是降级 TensorFlow 版本,另一种是使用 'tf.compat.v1.keras.backend.get_session' 替代 'tensorflow.keras.backend.get_session'。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [解决tensorflow报错:AttributeError: module ‘tensorflow.keras.backend‘ has no attribute ‘get_...](https://blog.csdn.net/weixin_41010198/article/details/107659012)[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%"]
- *2* *3* [解决 AttributeError: module ‘tensorflow.keras.utils‘ has no attribute ‘multi_gpu_model](https://blog.csdn.net/dou3516/article/details/120077201)[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 ]
阅读全文