models icon indicating copy to clipboard operation
models copied to clipboard

Error in object_detection_tutorial.ipynb:u'TensorArrayV3'

Open grapefruitXLJ opened this issue 9 years ago • 16 comments

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'

grapefruitXLJ avatar Jun 19 '17 02:06 grapefruitXLJ

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.

IvonaTau avatar Jun 19 '17 07:06 IvonaTau

Can you comment on this @derekjchow? Based on @IvonaTau's comment, perhaps this is related (but different) from #1597?

tatatodd avatar Jun 20 '17 02:06 tatatodd

try installing python 3.5

Prakash19921206 avatar Jun 28 '17 23:06 Prakash19921206

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.

derekjchow avatar Jun 28 '17 23:06 derekjchow

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'

tmd1wkd avatar Jun 29 '17 08:06 tmd1wkd

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'

thirdperspective avatar Jul 06 '17 11:07 thirdperspective

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'

jackfan00 avatar Jul 20 '17 16:07 jackfan00

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.

jtdowdall avatar Jul 20 '17 23:07 jtdowdall

after kernel install , my virtualenv has tf 1.2.1 and runs fine.

jackfan00 avatar Jul 21 '17 03:07 jackfan00

I receive this error on romilly/rpi-docker-tensorflow docker image on raspberry pi. Python 2.7.9 on Linux 1f7d8ec308e5 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

kaskavalci avatar Aug 12 '17 18:08 kaskavalci

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'

planetceres avatar Aug 23 '17 18:08 planetceres

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.

planetceres avatar Aug 23 '17 21:08 planetceres

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

ngochuancst avatar Oct 27 '17 07:10 ngochuancst

How can I remove the KeyError: TensorArrayV3

NoMoreHiding27 avatar May 09 '18 11:05 NoMoreHiding27

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'

gw00207 avatar Jun 25 '18 10:06 gw00207

I facing the same problem,please help me thank you!

cdlwhm1217096231 avatar Aug 30 '18 08:08 cdlwhm1217096231