TensorRT 记录(Tensorrt record)

1、ONNX模型转换成TensorRT 引擎(.engine)

1)调用trtexec转换工具,来源NVIDIA官方案例

trtexec --onnx=fcn-resnet101.onnx --fp16 --workspace=64 --minShapes=input:1x3x256x256 --optShapes=input:1x3x1026x1282 --maxShapes=input:1x3x1440x2560 --buildOnly --saveEngine=fcn-resnet101.engine

2)报错:

Internal Error (Could not find any implementation for node ArgMax_260.

3)解决方法:

(1)将trtexec执行参数–workspace=128

(2)TensorRT的samples中trtexec对应C++代码:

config.setMaxWorkspaceSize(static_cast<size_t>(build.workspace) << 20);
————————

1. Convert onnx model to tensorrt engine (. Engine)

1) Call the trtexec conversion tool, which comes from the official case of NVIDIA

trtexec --onnx=fcn-resnet101.onnx --fp16 --workspace=64 --minShapes=input:1x3x256x256 --optShapes=input:1x3x1026x1282 --maxShapes=input:1x3x1440x2560 --buildOnly --saveEngine=fcn-resnet101.engine

2) Error reporting:

Internal Error (Could not find any implementation for node ArgMax_260.

3) Solution:

(1) The trtexec execution parameter — workspace = 128

(2) C + + code corresponding to trtexec in tensorrt samples:

config.setMaxWorkspaceSize(static_cast<size_t>(build.workspace) << 20);