首页 > 解决方案 > 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”

标签: pythontensorflowkeras

解决方案


您应该尝试将导入从 更改kerastensorflow.keras,因为似乎是 Tensorflow 版本更新导致了更改。

或者,您可以将您的 Tensorflow 版本降级为与您当前的调用方式兼容的版本。

该问题在此处详细说明:https ://github.com/keras-team/keras/issues/12783


推荐阅读