TensorRT 3.0 UffException: dtype <type 'numpy.uint8'> unknown

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

I have similar error

Using output node image_tensor
Converting to UFF graph
Traceback (most recent call last):
  File "/usr/local/bin/convert-to-uff", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/uff/bin/convert_to_uff.py", line 104, in main
    output_filename=args.output
  File "/usr/local/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/local/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 77, in from_tensorflow
    uff_metagraph_proto = uff_metagraph.to_uff()
  File "/usr/local/lib/python2.7/dist-packages/uff/model/meta_graph.py", line 39, in to_uff
    graphs=[graph.to_uff(debug) for graph in self.graphs],
  File "/usr/local/lib/python2.7/dist-packages/uff/model/graph.py", line 26, in to_uff
    graph = uff_pb.Graph(id=self.name, nodes=self._check_graph_and_get_nodes())
  File "/usr/local/lib/python2.7/dist-packages/uff/model/graph.py", line 46, in _check_graph_and_get_nodes
    raise extend_with_original_traceback(e, node._trace)
uff.model.exceptions.UffException: dtype <type 'numpy.uint8'> unknown

Originally defined at:
  File "/usr/local/bin/convert-to-uff", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/uff/bin/convert_to_uff.py", line 104, in main
    output_filename=args.output
  File "/usr/local/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/local/lib/python2.7/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 75, in from_tensorflow
    name="main")
  File "/usr/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter.py", line 64, in convert_tf2uff_graph
    uff_graph, input_replacements)
  File "/usr/local/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/local/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/local/lib/python2.7/dist-packages/uff/converters/tensorflow/converter_functions.py", line 20, in convert_placeholder
    uff_graph.input(shape, dtype, name)
  File "/usr/local/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/local/lib/python2.7/dist-packages/uff/model/graph.py", line 65, in _add_node
    node = Node(self, op, name, inputs, fields, extra_fields)

We created a new “Deep Learning Training and Inference” section in Devtalk to improve the experience for deep learning and accelerated computing, and HPC users:
https://devtalk.nvidia.com/default/board/301/deep-learning-training-and-inference-/

We are moving active deep learning threads to the new section.

URLs for topics will not change with the re-categorization. So your bookmarks and links will continue to work as earlier.

-Siddharth