!26886 [MSLITE] create lite session failed bug

Merge pull request !26886 from ling/op
This commit is contained in:
i-robot 2021-11-29 08:09:26 +00:00 committed by Gitee
commit bae00c995e
1 changed files with 1 additions and 3 deletions

View File

@ -74,7 +74,6 @@ Status ModelImpl::Build(const void *model_data, size_t data_size, ModelType mode
auto session = std::shared_ptr<session::LiteSession>(CreateLiteSession(lite_context));
if (session == nullptr) {
delete lite_context;
MS_LOG(ERROR) << "Allocate session failed.";
return kLiteNullptr;
}
@ -103,7 +102,6 @@ Status ModelImpl::Build(const std::string &model_path, ModelType model_type,
auto session = std::shared_ptr<session::LiteSession>(CreateLiteSession(lite_context));
if (session == nullptr) {
delete lite_context;
MS_LOG(ERROR) << "Allocate session failed.";
return kLiteNullptr;
}
@ -159,7 +157,6 @@ Status ModelImpl::Build() {
auto session = std::shared_ptr<session::LiteSession>(CreateLiteSession(lite_context));
if (session == nullptr) {
delete lite_context;
MS_LOG(ERROR) << "Allocate session failed.";
return kLiteNullptr;
}
@ -640,6 +637,7 @@ session::LiteSession *ModelImpl::CreateLiteSession(lite::InnerContext *context)
auto session = new (std::nothrow) lite::LiteSession();
if (session == nullptr) {
MS_LOG(ERROR) << "create session failed";
delete context;
return nullptr;
}