From a51817d7933a0df9d04ec74a555161f67c43e6d7 Mon Sep 17 00:00:00 2001 From: csy0225 <78470701+csy0225@users.noreply.github.com> Date: Wed, 18 May 2022 19:29:23 +0800 Subject: [PATCH] fix tensorrt dla int8 problem (#42826) --- paddle/fluid/inference/tensorrt/engine.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/tensorrt/engine.cc b/paddle/fluid/inference/tensorrt/engine.cc index 33386c746a..00a6b2ffbf 100644 --- a/paddle/fluid/inference/tensorrt/engine.cc +++ b/paddle/fluid/inference/tensorrt/engine.cc @@ -90,7 +90,9 @@ void TensorRTEngine::FreezeNetwork() { bool enable_int8 = (precision_ == AnalysisConfig::Precision::kInt8); if (enable_int8) { - infer_builder_config_->setFlag(nvinfer1::BuilderFlag::kFP16); + if (!use_dla_) { + infer_builder_config_->setFlag(nvinfer1::BuilderFlag::kFP16); + } infer_builder_config_->setFlag(nvinfer1::BuilderFlag::kINT8); if (calibrator_) { -- GitLab