Something wrong in the cell "Load a (frozen) Tensorflow model into memory":
OS: Ubuntu 16.04.2
TensorFlow Version: 1.2.0
source code:
detection_graph = tf.Graph()
with detection_graph.as_default():
od_graph_def = tf.GraphDef()
with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid:
serialized_graph = fid.read()
od_graph_def.ParseFromString(serialized_graph)
tf.import_graph_def(od_graph_def, name='')
KeyError Traceback (most recent call last)
5 serialized_graph = fid.read()
6 od_graph_def.ParseFromString(serialized_graph)
----> 7 tf.import_graph_def(od_graph_def, name='')
/home/su/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/importer.pyc in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list)
256 for node in graph_def.node:
257 # Set any default attr values that aren't present.
--> 258 op_def = op_dict[node.op]
259 for attr_def in op_def.attr:
260 key = attr_def.name
KeyError: u'TensorArrayV3'
Hi , I also get the same error on MacOS Sierra and Tensorflow 1.2.0. However It seems related only to Python 2 as when notebook is run with Python 3 kernel all is fine.
Can you comment on this @derekjchow? Based on @IvonaTau's comment, perhaps this is related (but different) from #1597?
try installing python 3.5
Could you also provide information on what model you're running?
This could also be based on the anaconda version you're running. I've tested on vanilla python2&3 with tensorflow 1.2 on Ubuntu 16.04 and have not seen this issue.
I also have the same error!
I'm running object detection model..
My env is Ubuntu 16.04.1 / Anaconda 4.3.22 / Python 3.5.3
jupyter==1.0.0 / tensorflow==0.10.0
Load a (frozen) Tensorflow model into memory.
KeyError Traceback (most recent call last)
5 serialized_graph = fid.read()
6 od_graph_def.ParseFromString(serialized_graph)
----> 7 tf.import_graph_def(od_graph_def, name='')
~/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/importer.py in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list)
250 for node in graph_def.node:
251 # Set any default attr values that aren't present.
--> 252 op_def = op_dict[node.op]
253 for attr_def in op_def.attr:
254 key = attr_def.name
KeyError: 'TensorArrayV3'
I am also facing same problem in the environment(ubuntu 14,python 2.7,tensorflow 0.12.1).
In windows environment(windows10,python 3.5,tensorflow 1.1.0,jupyter), it is working fine.
Error log:
tf.import_graph_def(od_graph_def, name='')
File "/usr/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 258, in import_graph_def
op_def = op_dict[node.op]
KeyError: u'TensorArrayV3'
same error in ubuntu 16.04 python 2.7.12 tensroflow 0.12.0-rc0
KeyError Traceback (most recent call last)
5 serialized_graph = fid.read()
6 od_graph_def.ParseFromString(serialized_graph)
----> 7 tf.import_graph_def(od_graph_def, name='')
/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.pyc in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list)
256 for node in graph_def.node:
257 # Set any default attr values that aren't present.
--> 258 op_def = op_dict[node.op]
259 for attr_def in op_def.attr:
260 key = attr_def.name
KeyError: u'TensorArrayV3'
I got the same error in ubuntu 14.04.5. I realized I forgot to use my virtualenv for the python notebook (http://ipython.readthedocs.io/en/stable/install/kernel_install.html).
My python3 was using tf 0.12.1 and giving me the error, my virtualenv has tf 1.2.1 and runs fine.
Make sure your tensorflow version is up to date.
after kernel install , my virtualenv has tf 1.2.1 and runs fine.
I receive this error on romilly/rpi-docker-tensorflow docker image on raspberry pi. Python 2.7.9on Linux 1f7d8ec308e5 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
Also seeing same error on:
MacOS Sierra 10.12.6
Tensorflow version 1.3.0
Python: 3.5.4 (also tried 3.6.0)
Anaconda 4.3.22
KeyError Traceback (most recent call last)
<ipython-input-7-0e97fbc26e6d> in <module>()
5 serialized_graph = fid.read()
6 od_graph_def.ParseFromString(serialized_graph)
----> 7 tf.import_graph_def(od_graph_def, name='')
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/framework/importer.py in import_graph_def(graph_def, input_map, return_elements, name, op_dict, producer_op_list)
256 for node in graph_def.node:
257 # Set any default attr values that aren't present.
--> 258 op_def = op_dict[node.op]
259 for attr_def in op_def.attr:
260 key = attr_def.name
KeyError: 'TensorArrayV3'
I found this worked after updating tensorflow in the root environment. The Anaconda kernel showed tensorflow 1.3.0, but the root environment was at 1.0.1.
The tutorial apparently needs tensorflow >= 1.2.0.
with your error? You should prepare the following libraries and note some things .
How can I remove the KeyError: TensorArrayV3
I also get this error, with tensorflow 1.7:
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 227, in _RemoveDefaultAttrs
op_def = op_dict[node.op]
KeyError: 'GRUBlockCell'
I facing the same problem,please help me thank you!
Most helpful comment
I found this worked after updating tensorflow in the root environment. The Anaconda kernel showed tensorflow
1.3.0, but the root environment was at1.0.1.The tutorial apparently needs tensorflow >=
1.2.0.