python - AttributeError 模块 'tensorflow' 在 python 3.7.6 MacOS 中没有属性
问题描述
我正在尝试运行此程序https://github.com/catthatcodes/car-damage-assessment ,目前,我收到此错误。
Traceback(最近一次调用最后):文件“/Users/vikrant/Downloads/Car/catthatcodes/app/app.py”,第 7 行,在模块中
from pipeline import pipeline
graph = tf.get_default_graph()
AttributeError:模块“tensorflow”没有属性“get_default_graph”
解决方案
您应该尝试将导入从 更改keras
为tensorflow.keras
,因为似乎是 Tensorflow 版本更新导致了更改。
或者,您可以将您的 Tensorflow 版本降级为与您当前的调用方式兼容的版本。
该问题在此处详细说明:https ://github.com/keras-team/keras/issues/12783
推荐阅读
- captiva - 处理 Captiva 中的模块处理失败
- operators - { } 和 '{ } 之间的区别
- java - Spring Boot Web 应用程序中的响应如何转换为 JSON?
- python - 我正在开发一个聊天机器人,它显示以下问题
- c# - 使用 ssh 密钥访问 nuget 源
- google-apps-script - 进度完成后自动关闭模态
- pytorch - 有谁知道为什么 SHAP 的 Deep Explainer 在 ResNet-50 预训练模型上失败?
- javascript - 如何在 ReactJs 中添加 C++ 的图标
- database - Laravel / 数据库 - 安全
- c# - WPF:TreeViewItem 数据触发器