I have a network in ONNX format (opset 11). Importing in in python,
import tensorrt as trt TRT_LOGGER = trt.Logger(trt.Logger.VERBOSE) EXPLICIT_BATCH = 1 << (int)(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH) with trt.Builder(TRT_LOGGER) as builder: with builder.create_network(EXPLICIT_BATCH) as network: with trt.OnnxParser(network, TRT_LOGGER) as parser: with open('net.onnx', 'rb') as model: parser.parse(model.read())
completes successfully. However,
builder.set_max_batch_size = 1
crashes the interpreter with a
Segmentation fault (core dumped).
trtexec --onnx=net.onnx --verbose
works find though. Any idea what could go wrong in python?