diff mbox series

[FFmpeg-devel,1/6] dnn_backend_openvino.c: add version mismatch reminder

Message ID 20210118125151.27280-1-yejun.guo@intel.com
State Accepted
Commit 0d5fd4999a2291d82fe5cc8a4c8157165536ba04
Headers show
Series [FFmpeg-devel,1/6] dnn_backend_openvino.c: add version mismatch reminder
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Guo, Yejun Jan. 18, 2021, 12:51 p.m. UTC
The OpenVINO model file format changes when OpenVINO goes to a new
release, it does not work if the versions between model file and
runtime are mismatched.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
---
 libavfilter/dnn/dnn_backend_openvino.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 8a7abb33f0..bb4ef3958f 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -544,8 +544,15 @@  DNNModel *ff_dnn_load_model_ov(const char *model_filename, const char *options,
         goto err;
 
     status = ie_core_read_network(ov_model->core, model_filename, NULL, &ov_model->network);
-    if (status != OK)
+    if (status != OK) {
+        ie_version_t ver;
+        ver = ie_c_api_version();
+        av_log(ctx, AV_LOG_ERROR, "Failed to read the network from model file %s,\n"
+                                  "Please check if the model version matches the runtime OpenVINO %s\n",
+                                   model_filename, ver.api_version);
+        ie_version_free(&ver);
         goto err;
+    }
 
     model->get_input = &get_input_ov;
     model->get_output = &get_output_ov;