TypeError: in method 'UffParser_register_output', argument 2 of type 'char const *'

Hello,

I would like to deploy on a TX2 my freshly trained YoloV3, which I’ve trained using just a single class (the rest is YoloV3 standard ).
I’ve been converting the YoloV3 model to protobuffer as intermediate format to be able to pass it to the UFFParser.

However when I try to perform the conversion I have this error:

Error

Traceback (most recent call last):
  File "/home/cesare/Projects/keras_to_tensorflow/test.py", line 16, in <module>
    parser.register_output(output_names)
TypeError: in method 'UffParser_register_output', argument 2 of type 'char const *'

Code

# Import TensorRT Modules
import tensorrt as trt
import uff
from tensorrt.parsers import uffparser

output_names = ['output_node0', 'output_node1', 'output_node2']

G_LOGGER = trt.infer.ConsoleLogger(trt.infer.LogSeverity.INFO)

# Load your newly created Tensorflow frozen model and convert it to UFF
uff_model = uff.from_tensorflow_frozen_model("yolov3-detect.pb", output_names)

# Create a UFF parser to parse the UFF file created from your TF Frozen model
parser = uffparser.create_uff_parser()
parser.register_input("input", (640,352,3),0)
parser.register_output(output_names)

Stdout

/usr/bin/python3.5 /home/cesare/Projects/keras_to_tensorflow/test.py
Using output node output_node0
Using output node output_node1
Using output node output_node2
Converting to UFF graph
Warning: No conversion function registered for layer: Identity yet.
Converting as custom op Identity output_node2
name: "output_node2"
op: "Identity"
input: "conv2d_75/BiasAdd"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}

Warning: No conversion function registered for layer: Pad yet.
Converting as custom op Pad zero_padding2d_3/Pad
name: "zero_padding2d_3/Pad"
op: "Pad"
input: "add_3/add"
input: "zero_padding2d_3/Pad/paddings"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "Tpaddings"
  value {
    type: DT_INT32
  }
}

Warning: No conversion function registered for layer: Pad yet.
Converting as custom op Pad zero_padding2d_2/Pad
name: "zero_padding2d_2/Pad"
op: "Pad"
input: "add_1/add"
input: "zero_padding2d_2/Pad/paddings"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "Tpaddings"
  value {
    type: DT_INT32
  }
}

Warning: No conversion function registered for layer: Pad yet.
Converting as custom op Pad zero_padding2d_1/Pad
name: "zero_padding2d_1/Pad"
op: "Pad"
input: "leaky_re_lu_1/LeakyRelu/Maximum"
input: "zero_padding2d_1/Pad/paddings"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "Tpaddings"
  value {
    type: DT_INT32
  }
}

Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting as custom op ResizeNearestNeighbor up_sampling2d_2/ResizeNearestNeighbor
name: "up_sampling2d_2/ResizeNearestNeighbor"
op: "ResizeNearestNeighbor"
input: "leaky_re_lu_66/LeakyRelu/Maximum"
input: "up_sampling2d_2/mul"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "align_corners"
  value {
    b: false
  }
}

Warning: No conversion function registered for layer: Pad yet.
Converting as custom op Pad zero_padding2d_4/Pad
name: "zero_padding2d_4/Pad"
op: "Pad"
input: "add_11/add"
input: "zero_padding2d_4/Pad/paddings"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "Tpaddings"
  value {
    type: DT_INT32
  }
}

Warning: No conversion function registered for layer: ResizeNearestNeighbor yet.
Converting as custom op ResizeNearestNeighbor up_sampling2d_1/ResizeNearestNeighbor
name: "up_sampling2d_1/ResizeNearestNeighbor"
op: "ResizeNearestNeighbor"
input: "leaky_re_lu_59/LeakyRelu/Maximum"
input: "up_sampling2d_1/mul"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "align_corners"
  value {
    b: false
  }
}

Warning: No conversion function registered for layer: Pad yet.
Converting as custom op Pad zero_padding2d_5/Pad
name: "zero_padding2d_5/Pad"
op: "Pad"
input: "add_19/add"
input: "zero_padding2d_5/Pad/paddings"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "Tpaddings"
  value {
    type: DT_INT32
  }
}

Warning: No conversion function registered for layer: Identity yet.
Converting as custom op Identity output_node1
name: "output_node1"
op: "Identity"
input: "conv2d_67/BiasAdd"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}

Warning: No conversion function registered for layer: Identity yet.
Converting as custom op Identity output_node0
name: "output_node0"
op: "Identity"
input: "conv2d_59/BiasAdd"
attr {
  key: "T"
  value {
    type: DT_FLOAT
  }
}

No. nodes: 1294
Traceback (most recent call last):
  File "/home/cesare/Projects/keras_to_tensorflow/test.py", line 16, in <module>
    parser.register_output(output_names)
TypeError: in method 'UffParser_register_output', argument 2 of type 'char const *'

Process finished with exit code 1

Any clue ? Do you need additional debug ?

Hi,

It looks like there are some non-supported layers in your model.
For example, ResizeNearestNeighbor, Pad, …

We provide an interface to add custom layer with UFF parser from TensorRT 4.0.

TensorRT 4.0 is only available for Desktop user currently.
Please wait for our announcement for the update of Jetson version.

Thanks.