未验证 提交 3816d221 编写于 作者: Z Zhaolong Xing 提交者: GitHub

Fix the CE error which caused by paddle-trt version (#18941)

* Fix Mask rcnn predictor
    1. refine memory optim algorithm to support the model with the block op.
    2. output diff : modify the affine channel fuse
    3. add condition_block_infer op
add interface for setting trt calib table dir
test=develop

* add the missing files.
test=develop

* 1 add trt fp16 support
test=develop

* fix trt fp16 ce error
test=develop

* add an vlog if the user use trt4 and specify fp16.
test=develop
上级 f745d6d9
...@@ -51,6 +51,7 @@ void TensorRTEngine::FreezeNetwork() { ...@@ -51,6 +51,7 @@ void TensorRTEngine::FreezeNetwork() {
// build engine. // build engine.
infer_builder_->setMaxBatchSize(max_batch_); infer_builder_->setMaxBatchSize(max_batch_);
infer_builder_->setMaxWorkspaceSize(max_workspace_); infer_builder_->setMaxWorkspaceSize(max_workspace_);
#if IS_TRT_VERSION_GE(5000)
bool enable_fp16 = (precision_ == AnalysisConfig::Precision::kHalf); bool enable_fp16 = (precision_ == AnalysisConfig::Precision::kHalf);
if (enable_fp16) { if (enable_fp16) {
bool support_fp16 = infer_builder_->platformHasFastFp16(); bool support_fp16 = infer_builder_->platformHasFastFp16();
...@@ -60,6 +61,11 @@ void TensorRTEngine::FreezeNetwork() { ...@@ -60,6 +61,11 @@ void TensorRTEngine::FreezeNetwork() {
"FP16 speed up, use FP32 instead."; "FP16 speed up, use FP32 instead.";
} }
} }
#else
LOG(INFO) << "Using FP16 in Paddle-trt must ensure that the version of TRT "
"is at least 5."
"So, use FP32 to run.";
#endif
bool enable_int8 = (precision_ == AnalysisConfig::Precision::kInt8); bool enable_int8 = (precision_ == AnalysisConfig::Precision::kInt8);
if (enable_int8) { if (enable_int8) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册