ci error fix

pull/5039/head
cjh9368 5 years ago
parent 86beb6e94b
commit 5ad3ebbde1

@ -190,7 +190,7 @@ float Benchmark::CompareData(const std::string &nodeName, std::vector<int> msSha
} }
oss << ") are different"; oss << ") are different";
std::cerr << oss.str() << std::endl; std::cerr << oss.str() << std::endl;
MS_LOG(ERROR) << "%s", oss.str().c_str(); MS_LOG(ERROR) << oss.str().c_str();
return RET_ERROR; return RET_ERROR;
} }
size_t errorCount = 0; size_t errorCount = 0;
@ -242,11 +242,13 @@ int Benchmark::CompareOutput() {
auto tensors = session->GetOutputsByName(nodeName); auto tensors = session->GetOutputsByName(nodeName);
if (tensors.empty()) { if (tensors.empty()) {
MS_LOG(ERROR) << "Cannot find output node: " << nodeName.c_str() << " , compare output data fail."; MS_LOG(ERROR) << "Cannot find output node: " << nodeName.c_str() << " , compare output data fail.";
std::cerr << "Cannot find output node: " << nodeName.c_str() << " , compare output data fail." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
// make sure tensor size is 1 // make sure tensor size is 1
if (tensors.size() != 1) { if (tensors.size() != 1) {
MS_LOG(ERROR) << "Only support 1 tensor with a name now."; MS_LOG(ERROR) << "Only support 1 tensor with a name now.";
std::cerr << "Only support 1 tensor with a name now." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
auto &tensor = tensors.front(); auto &tensor = tensors.front();
@ -274,13 +276,15 @@ int Benchmark::CompareOutput() {
std::cout << "=======================================================" << std::endl << std::endl; std::cout << "=======================================================" << std::endl << std::endl;
if (meanBias > this->_flags->accuracyThreshold) { if (meanBias > this->_flags->accuracyThreshold) {
MS_LOG(ERROR) << "Mean bias of all nodes is too big: " << meanBias << "%%"; MS_LOG(ERROR) << "Mean bias of all nodes is too big: " << meanBias << "%";
std::cerr << "Mean bias of all nodes is too big: " << meanBias << "%" << std::endl;
return RET_ERROR; return RET_ERROR;
} else { } else {
return RET_OK; return RET_OK;
} }
} else { } else {
MS_LOG(ERROR) << "Error in CompareData"; MS_LOG(ERROR) << "Error in CompareData";
std::cerr << "Error in CompareData" << std::endl;
std::cout << "=======================================================" << std::endl << std::endl; std::cout << "=======================================================" << std::endl << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -288,15 +292,18 @@ int Benchmark::CompareOutput() {
int Benchmark::MarkPerformance() { int Benchmark::MarkPerformance() {
MS_LOG(INFO) << "Running warm up loops..."; MS_LOG(INFO) << "Running warm up loops...";
std::cout << "Running warm up loops..." << std::endl;
for (int i = 0; i < _flags->warmUpLoopCount; i++) { for (int i = 0; i < _flags->warmUpLoopCount; i++) {
auto status = session->RunGraph(); auto status = session->RunGraph();
if (status != 0) { if (status != 0) {
MS_LOG(ERROR) << "Inference error %d" << status; MS_LOG(ERROR) << "Inference error " << status;
std::cerr << "Inference error " << status << std::endl;
return status; return status;
} }
} }
MS_LOG(INFO) << "Running benchmark loops..."; MS_LOG(INFO) << "Running benchmark loops...";
std::cout << "Running benchmark loops..." << std::endl;
uint64_t timeMin = 1000000; uint64_t timeMin = 1000000;
uint64_t timeMax = 0; uint64_t timeMax = 0;
uint64_t timeAvg = 0; uint64_t timeAvg = 0;
@ -306,7 +313,8 @@ int Benchmark::MarkPerformance() {
auto start = GetTimeUs(); auto start = GetTimeUs();
auto status = session->RunGraph(); auto status = session->RunGraph();
if (status != 0) { if (status != 0) {
MS_LOG(ERROR) << "Inference error %d" << status; MS_LOG(ERROR) << "Inference error " << status;
std::cerr << "Inference error " << status;
return status; return status;
} }
@ -332,6 +340,7 @@ int Benchmark::MarkPerformance() {
int Benchmark::MarkAccuracy() { int Benchmark::MarkAccuracy() {
MS_LOG(INFO) << "MarkAccuracy"; MS_LOG(INFO) << "MarkAccuracy";
std::cout << "MarkAccuracy" << std::endl;
for (size_t i = 0; i < msInputs.size(); i++) { for (size_t i = 0; i < msInputs.size(); i++) {
MS_ASSERT(msInputs.at(i) != nullptr); MS_ASSERT(msInputs.at(i) != nullptr);
MS_ASSERT(msInputs.at(i)->data_type() == TypeId::kNumberTypeFloat32); MS_ASSERT(msInputs.at(i)->data_type() == TypeId::kNumberTypeFloat32);
@ -345,18 +354,21 @@ int Benchmark::MarkAccuracy() {
auto status = session->RunGraph(); auto status = session->RunGraph();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Inference error " << status; MS_LOG(ERROR) << "Inference error " << status;
std::cerr << "Inference error " << status << std::endl;
return status; return status;
} }
status = ReadCalibData(); status = ReadCalibData();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Read calib data error " << status; MS_LOG(ERROR) << "Read calib data error " << status;
std::cerr << "Read calib data error " << status << std::endl;
return status; return status;
} }
status = CompareOutput(); status = CompareOutput();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Compare output error " << status; MS_LOG(ERROR) << "Compare output error " << status;
std::cerr << "Compare output error " << status << std::endl;
return status; return status;
} }
return RET_OK; return RET_OK;
@ -368,22 +380,26 @@ int Benchmark::RunBenchmark(const std::string &deviceType) {
std::string modelName = _flags->modelPath.substr(_flags->modelPath.find_last_of(DELIM_SLASH) + 1); std::string modelName = _flags->modelPath.substr(_flags->modelPath.find_last_of(DELIM_SLASH) + 1);
MS_LOG(INFO) << "start reading model file"; MS_LOG(INFO) << "start reading model file";
std::cout << "start reading model file" << std::endl;
size_t size = 0; size_t size = 0;
char *graphBuf = ReadFile(_flags->modelPath.c_str(), &size); char *graphBuf = ReadFile(_flags->modelPath.c_str(), &size);
if (graphBuf == nullptr) { if (graphBuf == nullptr) {
MS_LOG(ERROR) << "Read model file failed while running %s", modelName.c_str(); MS_LOG(ERROR) << "Read model file failed while running " << modelName.c_str();
std::cerr << "Read model file failed while running " << modelName.c_str() << std::endl;
return RET_ERROR; return RET_ERROR;
} }
auto model = lite::Model::Import(graphBuf, size); auto model = lite::Model::Import(graphBuf, size);
if (model == nullptr) { if (model == nullptr) {
MS_LOG(ERROR) << "Import model file failed while running %s", modelName.c_str(); MS_LOG(ERROR) << "Import model file failed while running " << modelName.c_str();
std::cerr << "Import model file failed while running " << modelName.c_str() << std::endl;
delete[](graphBuf); delete[](graphBuf);
return RET_ERROR; return RET_ERROR;
} }
delete[](graphBuf); delete[](graphBuf);
auto context = new (std::nothrow) lite::Context; auto context = new (std::nothrow) lite::Context;
if (context == nullptr) { if (context == nullptr) {
MS_LOG(ERROR) << "New context failed while running %s", modelName.c_str(); MS_LOG(ERROR) << "New context failed while running " << modelName.c_str();
std::cerr << "New context failed while running " << modelName.c_str() << std::endl;
return RET_ERROR; return RET_ERROR;
} }
if (_flags->device == "CPU") { if (_flags->device == "CPU") {
@ -406,12 +422,14 @@ int Benchmark::RunBenchmark(const std::string &deviceType) {
session = session::LiteSession::CreateSession(context); session = session::LiteSession::CreateSession(context);
delete (context); delete (context);
if (session == nullptr) { if (session == nullptr) {
MS_LOG(ERROR) << "CreateSession failed while running %s", modelName.c_str(); MS_LOG(ERROR) << "CreateSession failed while running ", modelName.c_str();
std::cout << "CreateSession failed while running ", modelName.c_str();
return RET_ERROR; return RET_ERROR;
} }
auto ret = session->CompileGraph(model); auto ret = session->CompileGraph(model);
if (ret != RET_OK) { if (ret != RET_OK) {
MS_LOG(ERROR) << "CompileGraph failed while running %s", modelName.c_str(); MS_LOG(ERROR) << "CompileGraph failed while running ", modelName.c_str();
std::cout << "CompileGraph failed while running ", modelName.c_str();
delete (session); delete (session);
delete (model); delete (model);
return ret; return ret;
@ -438,7 +456,8 @@ int Benchmark::RunBenchmark(const std::string &deviceType) {
if (!_flags->calibDataPath.empty()) { if (!_flags->calibDataPath.empty()) {
status = MarkAccuracy(); status = MarkAccuracy();
if (status != 0) { if (status != 0) {
MS_LOG(ERROR) << "Run MarkAccuracy error: %d" << status; MS_LOG(ERROR) << "Run MarkAccuracy error: " << status;
std::cout << "Run MarkAccuracy error: " << status << std::endl;
delete (session); delete (session);
delete (model); delete (model);
return status; return status;
@ -446,7 +465,8 @@ int Benchmark::RunBenchmark(const std::string &deviceType) {
} else { } else {
status = MarkPerformance(); status = MarkPerformance();
if (status != 0) { if (status != 0) {
MS_LOG(ERROR) << "Run MarkPerformance error: %d" << status; MS_LOG(ERROR) << "Run MarkPerformance error: " << status;
std::cout << "Run MarkPerformance error: " << status << std::endl;
delete (session); delete (session);
delete (model); delete (model);
return status; return status;
@ -515,37 +535,45 @@ int Benchmark::Init() {
if (this->_flags->loopCount < 1) { if (this->_flags->loopCount < 1) {
MS_LOG(ERROR) << "LoopCount:" << this->_flags->loopCount << " must be greater than 0"; MS_LOG(ERROR) << "LoopCount:" << this->_flags->loopCount << " must be greater than 0";
std::cerr << "LoopCount:" << this->_flags->loopCount << " must be greater than 0" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
if (this->_flags->numThreads < 1) { if (this->_flags->numThreads < 1) {
MS_LOG(ERROR) << "numThreads:" << this->_flags->numThreads << " must be greater than 0"; MS_LOG(ERROR) << "numThreads:" << this->_flags->numThreads << " must be greater than 0";
std::cerr << "numThreads:" << this->_flags->numThreads << " must be greater than 0" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
if (this->_flags->cpuBindMode == -1) { if (this->_flags->cpuBindMode == -1) {
MS_LOG(INFO) << "cpuBindMode = MID_CPU"; MS_LOG(INFO) << "cpuBindMode = MID_CPU";
std::cout << "cpuBindMode = MID_CPU" << std::endl;
} else if (this->_flags->cpuBindMode == 1) { } else if (this->_flags->cpuBindMode == 1) {
MS_LOG(INFO) << "cpuBindMode = HIGHER_CPU"; MS_LOG(INFO) << "cpuBindMode = HIGHER_CPU";
std::cout << "cpuBindMode = HIGHER_CPU" << std::endl;
} else { } else {
MS_LOG(INFO) << "cpuBindMode = NO_BIND"; MS_LOG(INFO) << "cpuBindMode = NO_BIND";
std::cout << "cpuBindMode = NO_BIND" << std::endl;
} }
this->_flags->inDataType = this->_flags->inDataTypeIn == "img" ? kImage : kBinary; this->_flags->inDataType = this->_flags->inDataTypeIn == "img" ? kImage : kBinary;
if (_flags->modelPath.empty()) { if (_flags->modelPath.empty()) {
MS_LOG(ERROR) << "modelPath is required"; MS_LOG(ERROR) << "modelPath is required";
std::cerr << "modelPath is required" << std::endl;
return 1; return 1;
} }
_flags->InitInputDataList(); _flags->InitInputDataList();
_flags->InitResizeDimsList(); _flags->InitResizeDimsList();
if (!_flags->resizeDims.empty() && _flags->resizeDims.size() != _flags->input_data_list.size()) { if (!_flags->resizeDims.empty() && _flags->resizeDims.size() != _flags->input_data_list.size()) {
MS_LOG(ERROR) << "Size of input resizeDims should be equal to size of input inDataPath"; MS_LOG(ERROR) << "Size of input resizeDims should be equal to size of input inDataPath";
std::cerr << "Size of input resizeDims should be equal to size of input inDataPath" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
if (_flags->device != "CPU" && _flags->device != "GPU") { if (_flags->device != "CPU" && _flags->device != "GPU") {
MS_LOG(ERROR) << "Device type:" << _flags->device << " is not supported."; MS_LOG(ERROR) << "Device type:" << _flags->device << " is not supported.";
std::cerr << "Device type:" << _flags->device << " is not supported." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -578,6 +606,7 @@ int RunBenchmark(int argc, const char **argv) {
auto status = mBenchmark.Init(); auto status = mBenchmark.Init();
if (status != 0) { if (status != 0) {
MS_LOG(ERROR) << "Benchmark init Error : " << status; MS_LOG(ERROR) << "Benchmark init Error : " << status;
std::cerr << "Benchmark init Error : " << status << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -587,17 +616,22 @@ int RunBenchmark(int argc, const char **argv) {
status = mBenchmark.RunBenchmark("CPU"); status = mBenchmark.RunBenchmark("CPU");
} else { } else {
MS_LOG(ERROR) << "Device type" << flags.device << " not support."; MS_LOG(ERROR) << "Device type" << flags.device << " not support.";
std::cerr << "Device type" << flags.device << " not support." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
if (status != 0) { if (status != 0) {
MS_LOG(ERROR) << "Run Benchmark " << flags.modelPath.substr(flags.modelPath.find_last_of(DELIM_SLASH) + 1).c_str() MS_LOG(ERROR) << "Run Benchmark " << flags.modelPath.substr(flags.modelPath.find_last_of(DELIM_SLASH) + 1).c_str()
<< " Failed : " << status; << " Failed : " << status;
std::cerr << "Run Benchmark " << flags.modelPath.substr(flags.modelPath.find_last_of(DELIM_SLASH) + 1).c_str()
<< " Failed : " << status << std::endl;
return RET_ERROR; return RET_ERROR;
} }
MS_LOG(INFO) << "Run Benchmark " << flags.modelPath.substr(flags.modelPath.find_last_of(DELIM_SLASH) + 1).c_str() MS_LOG(INFO) << "Run Benchmark " << flags.modelPath.substr(flags.modelPath.find_last_of(DELIM_SLASH) + 1).c_str()
<< " Success."; << " Success.";
std::cout << "Run Benchmark " << flags.modelPath.substr(flags.modelPath.find_last_of(DELIM_SLASH) + 1).c_str()
<< " Success." << std::endl;
return RET_OK; return RET_OK;
} }
} // namespace lite } // namespace lite

@ -42,6 +42,7 @@ int TimeProfile::GenerateInputData() {
auto input_data = tensor->MutableData(); auto input_data = tensor->MutableData();
if (input_data == nullptr) { if (input_data == nullptr) {
MS_LOG(ERROR) << "MallocData for inTensor failed"; MS_LOG(ERROR) << "MallocData for inTensor failed";
std::cerr << "MallocData for inTensor failed" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
MS_ASSERT(tensor->GetData() != nullptr); MS_ASSERT(tensor->GetData() != nullptr);
@ -49,6 +50,7 @@ int TimeProfile::GenerateInputData() {
auto status = GenerateRandomData(tensor_byte_size, input_data); auto status = GenerateRandomData(tensor_byte_size, input_data);
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Generate RandomData for inTensor failed " << status; MS_LOG(ERROR) << "Generate RandomData for inTensor failed " << status;
std::cerr << "Generate RandomData for inTensor failed " << status << std::endl;
return RET_ERROR; return RET_ERROR;
} }
} }
@ -66,12 +68,14 @@ int TimeProfile::ReadInputFile() {
size_t size; size_t size;
char *bin_buf = ReadFile(_flags->in_data_path_.c_str(), &size); char *bin_buf = ReadFile(_flags->in_data_path_.c_str(), &size);
if (bin_buf == nullptr) { if (bin_buf == nullptr) {
MS_LOG(ERROR) << "Input data file error, required: "; MS_LOG(ERROR) << "Read input data failed.";
std::cerr << "Read input data failed." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
auto tensor_data_size = inTensor->Size(); auto tensor_data_size = inTensor->Size();
if (size != tensor_data_size) { if (size != tensor_data_size) {
MS_LOG(ERROR) << "Input binary file size error, required: " << tensor_data_size << " in fact: " << size; MS_LOG(ERROR) << "Input binary file size error, required: " << tensor_data_size << " in fact: " << size;
std::cerr << "Input binary file size error, required: " << tensor_data_size << " in fact: " << size << std::endl;
return RET_ERROR; return RET_ERROR;
} }
auto input_data = inTensor->MutableData(); auto input_data = inTensor->MutableData();
@ -85,12 +89,14 @@ int TimeProfile::LoadInput() {
auto status = GenerateInputData(); auto status = GenerateInputData();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Generate input data error " << status; MS_LOG(ERROR) << "Generate input data error " << status;
std::cerr << "Generate input data error " << status << std::endl;
return RET_ERROR; return RET_ERROR;
} }
} else { } else {
auto status = ReadInputFile(); auto status = ReadInputFile();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "ReadInputFile error " << status; MS_LOG(ERROR) << "ReadInputFile error " << status;
std::cerr << "ReadInputFile error " << status << std::endl;
return RET_ERROR; return RET_ERROR;
} }
} }
@ -102,6 +108,7 @@ int TimeProfile::InitSession() {
char *graph_buf = ReadFile(_flags->model_path_.c_str(), &size); char *graph_buf = ReadFile(_flags->model_path_.c_str(), &size);
if (graph_buf == nullptr) { if (graph_buf == nullptr) {
MS_LOG(ERROR) << "Load graph failed, path " << _flags->model_path_; MS_LOG(ERROR) << "Load graph failed, path " << _flags->model_path_;
std::cerr << "Load graph failed, path " << _flags->model_path_ << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -113,6 +120,7 @@ int TimeProfile::InitSession() {
session_ = session::LiteSession::CreateSession(ctx); session_ = session::LiteSession::CreateSession(ctx);
if (session_ == nullptr) { if (session_ == nullptr) {
MS_LOG(ERROR) << "New session failed while running."; MS_LOG(ERROR) << "New session failed while running.";
std::cerr << "New session failed while running." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -179,11 +187,13 @@ int TimeProfile::Init() {
if (_flags->num_threads_ < 1) { if (_flags->num_threads_ < 1) {
MS_LOG(ERROR) << "NumThreads: " << _flags->num_threads_ << " must greater than or equal 1"; MS_LOG(ERROR) << "NumThreads: " << _flags->num_threads_ << " must greater than or equal 1";
std::cerr << "NumThreads: " << _flags->num_threads_ << " must greater than or equal 1" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
if (_flags->loop_count_ < 1) { if (_flags->loop_count_ < 1) {
MS_LOG(ERROR) << "LoopCount: " << _flags->loop_count_ << " must greater than or equal 1"; MS_LOG(ERROR) << "LoopCount: " << _flags->loop_count_ << " must greater than or equal 1";
std::cerr << "LoopCount: " << _flags->loop_count_ << " must greater than or equal 1" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -200,24 +210,28 @@ int TimeProfile::Init() {
if (_flags->model_path_.empty()) { if (_flags->model_path_.empty()) {
MS_LOG(ERROR) << "modelPath is required"; MS_LOG(ERROR) << "modelPath is required";
std::cerr << "modelPath is required" << std::endl;
return RET_ERROR; return RET_ERROR;
} }
auto status = InitSession(); auto status = InitSession();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Init session failed."; MS_LOG(ERROR) << "Init session failed.";
std::cerr << "Init session failed." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
status = this->LoadInput(); status = this->LoadInput();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Load input failed."; MS_LOG(ERROR) << "Load input failed.";
std::cerr << "Load input failed." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
status = InitCallbackParameter(); status = InitCallbackParameter();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Init callback Parameter failed."; MS_LOG(ERROR) << "Init callback Parameter failed.";
std::cerr << "Init callback Parameter failed." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
@ -299,6 +313,7 @@ int TimeProfile::RunTimeProfile() {
char *graphBuf = ReadFile(_flags->model_path_.c_str(), &size); char *graphBuf = ReadFile(_flags->model_path_.c_str(), &size);
if (graphBuf == nullptr) { if (graphBuf == nullptr) {
MS_LOG(ERROR) << "Load graph failed while running " << modelName.c_str(); MS_LOG(ERROR) << "Load graph failed while running " << modelName.c_str();
std::cerr << "Load graph failed while running " << modelName.c_str() << std::endl;
delete graphBuf; delete graphBuf;
delete session_; delete session_;
return RET_ERROR; return RET_ERROR;
@ -307,6 +322,7 @@ int TimeProfile::RunTimeProfile() {
delete graphBuf; delete graphBuf;
if (model == nullptr) { if (model == nullptr) {
MS_LOG(ERROR) << "Import model file failed while running " << modelName.c_str(); MS_LOG(ERROR) << "Import model file failed while running " << modelName.c_str();
std::cerr << "Import model file failed while running " << modelName.c_str() << std::endl;
delete session_; delete session_;
delete model; delete model;
return RET_ERROR; return RET_ERROR;
@ -314,6 +330,7 @@ int TimeProfile::RunTimeProfile() {
auto ret = session_->CompileGraph(model); auto ret = session_->CompileGraph(model);
if (ret != RET_OK) { if (ret != RET_OK) {
MS_LOG(ERROR) << "Compile graph failed."; MS_LOG(ERROR) << "Compile graph failed.";
std::cerr << "Compile graph failed." << std::endl;
delete session_; delete session_;
delete model; delete model;
return RET_ERROR; return RET_ERROR;
@ -324,6 +341,7 @@ int TimeProfile::RunTimeProfile() {
auto status = LoadInput(); auto status = LoadInput();
if (status != RET_OK) { if (status != RET_OK) {
MS_LOG(ERROR) << "Generate input data error"; MS_LOG(ERROR) << "Generate input data error";
std::cerr << "Generate input data error" << std::endl;
delete session_; delete session_;
delete model; delete model;
return status; return status;
@ -337,6 +355,7 @@ int TimeProfile::RunTimeProfile() {
ret = session_->RunGraph(before_call_back_, after_call_back_); ret = session_->RunGraph(before_call_back_, after_call_back_);
if (ret != RET_OK) { if (ret != RET_OK) {
MS_LOG(ERROR) << "Run graph failed."; MS_LOG(ERROR) << "Run graph failed.";
std::cerr << "Run graph failed." << std::endl;
delete session_; delete session_;
delete model; delete model;
return RET_ERROR; return RET_ERROR;
@ -384,12 +403,14 @@ int RunTimeProfile(int argc, const char **argv) {
auto ret = time_profile.Init(); auto ret = time_profile.Init();
if (ret != RET_OK) { if (ret != RET_OK) {
MS_LOG(ERROR) << "Init TimeProfile failed."; MS_LOG(ERROR) << "Init TimeProfile failed.";
std::cerr << "Init TimeProfile failed." << std::endl;
return RET_ERROR; return RET_ERROR;
} }
ret = time_profile.RunTimeProfile(); ret = time_profile.RunTimeProfile();
if (ret != RET_OK) { if (ret != RET_OK) {
MS_LOG(ERROR) << "Run TimeProfile failed."; MS_LOG(ERROR) << "Run TimeProfile failed.";
std::cerr << "Run TimeProfile failed." << std::endl;
return RET_ERROR; return RET_ERROR;
} }

Loading…
Cancel
Save