cyrusbehr / tensorrt-cpp-api

TensorRT C++ API Tutorial
MIT License
596 stars 74 forks source link

builder->buildSerializedNetwork fail #34

Closed vvxt closed 7 months ago

vvxt commented 10 months ago

snap_20231124182658

envs: windows 11 NVIDIA GeForce RTX3050 Laptop vs2022

export ONNX: format=onnx dynamic=True simplify=True

Options: precision=Precision::FP16 optBatchSize=32 maxBatchSize=64

but use trtexec.exe can work properly.

cyrusbehr commented 10 months ago

Increase log level to verbose to understand why it's failing.

image

vvxt commented 10 months ago

20231128175639 Log with set severity to kVERBOSE @cyrusbehr

cyrusbehr commented 9 months ago

Hi @vvxt Can you send me the model please.

cyrusbehr commented 8 months ago

@vvxt please also specify what Options you are using. Are you using default? Or did you change them?

    // Specify our GPU inference configuration options
    Options options;
    // Specify what precision to use for inference
    // FP16 is approximately twice as fast as FP32.
    options.precision = Precision::FP16;
    // If using INT8 precision, must specify path to directory containing calibration data.
    options.calibrationDataDirectoryPath = "";
    // If the model does not support dynamic batch size, then the below two parameters must be set to 1.
    // Specify the batch size to optimize for.
    options.optBatchSize = 1;
    // Specify the maximum batch size we plan on running.
    options.maxBatchSize = 1;

    Engine engine(options);
cyrusbehr commented 7 months ago

Closing due to inactivity. Please rep-open once you can provide the above information.