gpt4 book ai didi

python - 属性错误 : module 'tensorflow' has no attribute 'GraphDef'

转载 作者:行者123 更新时间:2023-11-28 19:05:06 25 4
gpt4 key购买 nike

尝试在 PyCharm 2017.3.1 中运行以下内容:

with open('../data/UrbanSound8K/retrained_graph.pb', 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
tf.import_graph_def(graph_def, name='')

我收到以下内容:

/anaconda/bin/python3 /Users/PycharmProjects/UrbanSound/src/recognize_sound.py
Traceback (most recent call last):
File "/Users/PycharmProjects/UrbanSound/src/recognize_sound.py", line 12, in <module>
graph_def = tf.GraphDef()
AttributeError: module 'tensorflow' has no attribute 'GraphDef'

这里是一些环境信息:

(tensorflow) $ python3 -c 'import tensorflow as tf; print(tf.__version__)'
1.4.0
(tensorflow) $ python -V
Python 3.6.2

预先感谢您的帮助。

最佳答案

我用

解决了它

python36 -m pip install tensorflow-gpu==1.14

关于python - 属性错误 : module 'tensorflow' has no attribute 'GraphDef' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47945077/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com