Models: Error in object_detection_tutorial.ipynb:u'TensorArrayV3'

Created on 19 Jun 2017  路  16Comments  路  Source: tensorflow/models

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)
in ()
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'

awaiting model gardener

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 at 1.0.1.

The tutorial apparently needs tensorflow >= 1.2.0.

All 16 comments

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)
in ()
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)
in ()
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 .

  1. Are you sure you are building on any python version? python 2.7 or python 3.6
  2. check tensorflow version, and needs tensorflow >= 1.2.0. and how to install or upgrade then you can search.
  3. You need to prepare all the files for pythonc to be able to build. If you refer to it at https://github.com/tensorflow/models/tree/master/research/object_detection.
    4.You modify the file path and variables in the previous program to match before building
  4. good luck

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hanzy123 picture hanzy123  路  3Comments

kamal4493 picture kamal4493  路  3Comments

nmfisher picture nmfisher  路  3Comments

Mostafaghelich picture Mostafaghelich  路  3Comments

XavDCtpz picture XavDCtpz  路  3Comments