In attempting to run the following in 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='')
I receive the following:
/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'
Here is some environment information:
(tensorflow) $ python3 -c 'import tensorflow as tf; print(tf.__version__)'
1.4.0
(tensorflow) $ python -V
Python 3.6.2
Thank you in advance for your help.
GraphDef?python3 -c ...for tf version, but you ranpython -Vfor your python version, is python3 set as 3.6.2 (same as python) ?