Closed SolDogLi closed 1 year ago
you need https://docs.nvidia.com/deeplearning/tensorrt/api/python_api/infer/Core/BuilderConfig.html#tensorrt.BuilderFlag OBEY_PRECISION_CONSTRAINTS
Or use trtexec with --precisionConstraints=obey --layerPrecisions=spec
@SolDogLi you can also refer to this example of how we are setting specific layers to fp16 wne doing mixed precision between int8 and fp16.
Description
outputs of onnx to tensorrt are different from outputs of onnx,I want to know how to set the layer to fp32 in setFlag(nvinfer1::BuilderFlag::kFP16)?
Environment
TensorRT Version: 8.2.3 NVIDIA GPU: RTS 2060 NVIDIA Driver Version: 470.141.03 CUDA Version: 11.4 CUDNN Version: 8.1 Operating System: ubuntu18.04 Python Version (if applicable): 3.7 Tensorflow Version (if applicable): PyTorch Version (if applicable): 1.10.0 Baremetal or Container (if so, version):
Relevant Files
https://drive.google.com/file/d/1-koOd12w1BNrXyWUP_9E17pWL7aUqLVy/view?usp=sharing
Steps To Reproduce
fp32 onnx to fp16 tensorrt and compare polygraphy run /home/gxl/Videos/BEVerse/BEVerse/onnx_model/mtl_singleframe_head_outGS_bevpool.par.onnx --onnxrt --trt --atol 1e-3 --rtol 1e-3 --fp16 --verbose
and then I want to set some layer to fp32,I added the following code to onnx-tensorrt to set all layers as FP32 , but it doesn't seem to work:
but the output is basically unchanged. Is there a way to individually set some layers to fp32?
Thanks!