mark accuracy cannot find output node bug fix

This commit is contained in:
cjh9368 2020-08-04 21:05:57 +08:00
parent 276d5aba9f
commit 1e3f83ce50
1 changed files with 4 additions and 0 deletions

View File

@ -230,6 +230,10 @@ int Benchmark::CompareOutput() {
for (const auto &calibTensor : calibData) {
std::string nodeName = calibTensor.first;
auto tensors = session->GetOutputsByName(nodeName);
if (tensors.empty()) {
MS_LOG(ERROR) << "Cannot find output node: " << nodeName.c_str() << " , compare output data fail.";
return RET_ERROR;
}
for (auto tensor : tensors) {
MS_ASSERT(tensor->GetDataType() == DataType_DT_FLOAT);
MS_ASSERT(tensor->GetData() != nullptr);