I’m trying to convert a frozen_graph of a modified out of the box SSD tensorflow model and am running into this error. Here’s what I’m running and stacktrace:
In [12]: uff.from_tensorflow_frozen_model('frozen_inference_graph.pb', ['image_tensor'])
Using output node image_tensor
Converting to UFF graph
---------------------------------------------------------------------------
UffException Traceback (most recent call last)
<ipython-input-12-b9577f6b1836> in <module>()
----> 1 uff.from_tensorflow_frozen_model('frozen_inference_graph.pb', ['image_tensor'])
/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.pyc in from_tensorflow_frozen_model(frozen_file, output_nodes, **kwargs)
101 graphdef.ParseFromString(open(frozen_file, "rb").read())
102
--> 103 return from_tensorflow(graphdef, output_nodes, **kwargs)
/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.pyc in from_tensorflow(graphdef, output_nodes, **kwargs)
75 name="main")
76
---> 77 uff_metagraph_proto = uff_metagraph.to_uff()
78 if not quiet:
79 print('No. nodes:', len(uff_graph.nodes))
/usr/lib/python2.7/dist-packages/uff/model/meta_graph.pyc in to_uff(self, debug)
37 descriptor_core_version=self.descriptor.version,
38 descriptors=[desc.to_uff(debug) for desc in self.descriptor.descriptors_extended],
---> 39 graphs=[graph.to_uff(debug) for graph in self.graphs],
40 referenced_data=referenced_data)
41
/usr/lib/python2.7/dist-packages/uff/model/graph.pyc in to_uff(self, debug)
24
25 def to_uff(self, debug=False):
---> 26 graph = uff_pb.Graph(id=self.name, nodes=self._check_graph_and_get_nodes())
27 if debug:
28 graph = uff_pb.Graph(id=self.name,
/usr/lib/python2.7/dist-packages/uff/model/graph.pyc in _check_graph_and_get_nodes(self)
44 nodes.append(self._check_and_get_node(node))
45 except Exception as e:
---> 46 raise extend_with_original_traceback(e, node._trace)
47
48 return nodes
UffException: dtype <type 'numpy.uint8'> unknown
Originally defined at:
File "/usr/bin/ipython", line 5, in <module>
start_ipython()
File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 565, in launch_instance
app.start()
File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 371, in start
self.shell.mainloop()
File "/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py", line 443, in mainloop
self.interact(display_banner=display_banner)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py", line 567, in interact
self.run_cell(source_raw, store_history=True)
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2741, in run_cell
interactivity=interactivity, compiler=compiler)
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2833, in run_ast_nodes
if self.run_code(code):
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2883, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-12-b9577f6b1836>", line 1, in <module>
uff.from_tensorflow_frozen_model('frozen_inference_graph.pb', ['image_tensor'])
File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 103, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, **kwargs)
File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 75, in from_tensorflow
name="main")
File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 64, in convert_tf2uff_graph
uff_graph, input_replacements)
File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 51, in convert_tf2uff_node
op, name, tf_node, inputs, uff_graph, tf_nodes=tf_nodes)
File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 32, in convert_layer
return cls.registry_[op](name, tf_node, inputs, uff_graph, **kwargs)
File "/usr/lib/python2.7/dist-packages/uff/converters/tensorflow/converter_functions.py", line 20, in convert_placeholder
uff_graph.input(shape, dtype, name)
File "/usr/lib/python2.7/dist-packages/uff/model/graph.py", line 74, in input
return self._add_node("Input", name, fields=fields, extra_fields=extra_fields)
File "/usr/lib/python2.7/dist-packages/uff/model/graph.py", line 65, in _add_node
node = Node(self, op, name, inputs, fields, extra_fields)
our Tensors our UINT-8s. Is this a problem? I’m also curious if anyone has tried or had issues with converting a quantized tensorflow model into uff format?
https://www.tensorflow.org/performance/quantization