From 59c374ec4a94b7ff7de48599228b7a11256697c1 Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Tue, 2 Aug 2022 13:01:31 +0800 Subject: [PATCH] fixed paddle inference cpu_num_threads setting (#64) --- csrcs/fastdeploy/fastdeploy_runtime.cc | 2 +- examples/resources/.gitignore | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/csrcs/fastdeploy/fastdeploy_runtime.cc b/csrcs/fastdeploy/fastdeploy_runtime.cc index 1f782a54ae9..9207d5cae63 100644 --- a/csrcs/fastdeploy/fastdeploy_runtime.cc +++ b/csrcs/fastdeploy/fastdeploy_runtime.cc @@ -212,7 +212,6 @@ void RuntimeOption::SetTrtCacheFile(const std::string& cache_file_path) { trt_serialize_file = cache_file_path; } - bool Runtime::Init(const RuntimeOption& _option) { option = _option; if (option.model_format == Frontend::AUTOREC) { @@ -274,6 +273,7 @@ void Runtime::CreatePaddleBackend() { pd_option.mkldnn_cache_size = option.pd_mkldnn_cache_size; pd_option.use_gpu = (option.device == Device::GPU) ? true : false; pd_option.gpu_id = option.device_id; + pd_option.cpu_thread_num = option.cpu_thread_num; FDASSERT(option.model_format == Frontend::PADDLE, "PaddleBackend only support model format of Frontend::PADDLE."); backend_ = new PaddleBackend(); diff --git a/examples/resources/.gitignore b/examples/resources/.gitignore index f8c24f7a602..aadf7025293 100644 --- a/examples/resources/.gitignore +++ b/examples/resources/.gitignore @@ -6,6 +6,10 @@ models/*.pd* models/*.engine models/*.trt models/*.nb +models/*param* +models/*model* outputs/*.jpg outputs/*.jpeg -outputs/*.png \ No newline at end of file +outputs/*.png +outputs/*.txt +outputs/*.json \ No newline at end of file