From b7ea5a3ef0823f7ccdd0065a5dccc3c7bd93ecee Mon Sep 17 00:00:00 2001 From: lixian Date: Thu, 25 Mar 2021 11:04:00 +0800 Subject: [PATCH] fix bind thread --- mindspore/lite/src/cxx_api/model/model_impl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/lite/src/cxx_api/model/model_impl.cc b/mindspore/lite/src/cxx_api/model/model_impl.cc index 85a32b1d72..51c3054735 100644 --- a/mindspore/lite/src/cxx_api/model/model_impl.cc +++ b/mindspore/lite/src/cxx_api/model/model_impl.cc @@ -118,7 +118,6 @@ Status ModelImpl::Build() { MS_LOG(ERROR) << "Build model failed."; return static_cast(ret); } - session->BindThread(true); session_.swap(session); model->Free(); MS_LOG(DEBUG) << "Build model success."; @@ -180,7 +179,9 @@ Status ModelImpl::Predict(const std::vector &inputs, std::vectorBindThread(true); auto ret = session_->RunGraph(); + session_->BindThread(false); ResetTensorData(old_data, input_tensors); if (ret != RET_OK) { MS_LOG(ERROR) << "Run graph failed.";