What if blob names of model unknown?

When transferring a caffe/onnx model to trt model, we need to know the blob name, then specify the binding index to the buffer. What if we don’t know the blob name?


You can build the engine without knowing the blob names.

But at runtime you need to know how to make the order of pointers you supply in TRT’s argument array correspond to the inputs and outputs of the model.

You can either query the INetworkDefinition for the names after parsing, or you can query the IEngine at runtime.

If you only have one input and one output, then you can find out from the engine which is which. But beyond that, you need the names.

(Or, if you know the tensor dimensions and they’re different, then you can figure it out. Etc.)