Browse Source

!14047 [MS][LITE][Develop]fix use of bind thread

From: @lx0095
Reviewed-by: @zhang_xue_tong,@hangangqiang
Signed-off-by: @zhang_xue_tong
pull/14047/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
c330ff9221
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      mindspore/lite/src/cxx_api/model/model_impl.cc

+ 2
- 1
mindspore/lite/src/cxx_api/model/model_impl.cc View File

@@ -118,7 +118,6 @@ Status ModelImpl::Build() {
MS_LOG(ERROR) << "Build model failed.";
return static_cast<StatusCode>(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<MSTensor> &inputs, std::vector<MSTen
}
}
}
session_->BindThread(true);
auto ret = session_->RunGraph();
session_->BindThread(false);
ResetTensorData(old_data, input_tensors);
if (ret != RET_OK) {
MS_LOG(ERROR) << "Run graph failed.";


Loading…
Cancel
Save