diff --git a/mediapipe/calculators/ovms/modelapiovmsadapter.cc b/mediapipe/calculators/ovms/modelapiovmsadapter.cc index e7fa510c5e..a5e8d8235a 100644 --- a/mediapipe/calculators/ovms/modelapiovmsadapter.cc +++ b/mediapipe/calculators/ovms/modelapiovmsadapter.cc @@ -260,7 +260,16 @@ void OVMSInferenceAdapter::loadModel(const std::shared_ptr& mod } const ov::AnyMap* servableMetadataRtInfo; ASSERT_CAPI_STATUS_NULL(OVMS_ServableMetadataInfo(servableMetadata, reinterpret_cast(&servableMetadataRtInfo))); - this->modelConfig = *servableMetadataRtInfo; + try { + if ((*servableMetadataRtInfo).count("model_info") == 0) { + this->modelConfig = ov::AnyMap{}; + } else { + this->modelConfig = (*servableMetadataRtInfo).at("model_info").as(); + } + } catch (const std::exception& e) { + LOG(INFO) << "Exception occurred while accessing model_info: " << e.what(); + this->modelConfig = ov::AnyMap{}; + } } ov::element::Type_t OVMSInferenceAdapter::getInputDatatype(const std::string& inputName) const {