From 48918c78568f226e32d9ed52eb4bad28c6be5295 Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Mon, 5 Aug 2024 17:44:38 +0900 Subject: [PATCH 1/3] Update openvino-dev==2023.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c852cea1..204e507a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" name = "openvino_xai" version = "1.1.0rc0" dependencies = [ - "openvino-dev==2024.2", + "openvino-dev==2024.3", "opencv-python", "scipy", "numpy==1.*", From 49bee590c941bcb6bb01f11f40f3b615901abeda Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Tue, 6 Aug 2024 15:23:18 +0900 Subject: [PATCH 2/3] Update tests --- openvino_xai/methods/white_box/recipro_cam.py | 4 ++-- tests/func/test_classification_timm_full.py | 24 +++---------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/openvino_xai/methods/white_box/recipro_cam.py b/openvino_xai/methods/white_box/recipro_cam.py index e552049b..da516125 100644 --- a/openvino_xai/methods/white_box/recipro_cam.py +++ b/openvino_xai/methods/white_box/recipro_cam.py @@ -233,10 +233,10 @@ def _get_saliency_map(self, model_clone: ov.Model) -> ov.Node: norm_node_ori = self._get_non_add_node_from_two_nodes(post_target_node_ori) while norm_node_ori.get_type_name() != "Add": if len(norm_node_ori.outputs()) > 1: - raise ValueError + raise ValueError("Number of normalization outputs > 1!") inputs = norm_node_ori.output(0).get_target_inputs() if len(inputs) > 1: - raise ValueError + raise ValueError("Number of normalization inputs > 1!") norm_node_ori = next(iter(inputs)).get_node() # Mosaic feature map after the LayerNorm diff --git a/tests/func/test_classification_timm_full.py b/tests/func/test_classification_timm_full.py index e7bc6a5f..73845a64 100644 --- a/tests/func/test_classification_timm_full.py +++ b/tests/func/test_classification_timm_full.py @@ -32,36 +32,19 @@ SUPPORTED_BUT_FAILED_BY_BB_MODELS = {} NOT_SUPPORTED_BY_BB_MODELS = { - "_nfnet_": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "convit": "RuntimeError: Couldn't get TorchScript module by tracing.", - "convnext_xxlarge": "RuntimeError: The serialized model is larger than the 2GiB limit imposed by the protobuf library.", - "convnextv2_huge": "RuntimeError: The serialized model is larger than the 2GiB limit imposed by the protobuf library.", - "deit3_huge": "RuntimeError: The serialized model is larger than the 2GiB limit imposed by the protobuf library.", - "dm_nfnet": "openvino._pyopenvino.GeneralFailure: Check 'false' failed at src/frontends/onnx/frontend/src/frontend.cpp:144", - "eca_nfnet": "openvino._pyopenvino.GeneralFailure: Check 'false' failed at src/frontends/onnx/frontend/src/frontend.cpp:144", - "eva_giant": "RuntimeError: The serialized model is larger than the 2GiB limit imposed by the protobuf library.", - # "halo": "torch.onnx.errors.SymbolicValueError: Unsupported: ONNX export of operator Unfold, input size not accessible.", - "nf_regnet": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "nf_resnet": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "nfnet_l0": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "regnety_1280": "RuntimeError: The serialized model is larger than the 2GiB limit imposed by the protobuf library.", - "regnety_2560": "RuntimeError: The serialized model is larger than the 2GiB limit imposed by the protobuf library.", "repvit": "urllib.error.HTTPError: HTTP Error 404: Not Found", - "resnetv2": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", "tf_efficientnet_cc": "torch.onnx.errors.SymbolicValueError: Unsupported: ONNX export of convolution for kernel of unknown shape.", "vit_base_r50_s16_224.orig_in21k": "RuntimeError: Error(s) in loading state_dict for VisionTransformer", "vit_gigantic_patch16_224_ijepa.in22k": "RuntimeError: shape '[1, 13, 13, -1]' is invalid for input of size 274560", "vit_huge_patch14_224.orig_in21k": "RuntimeError: Error(s) in loading state_dict for VisionTransformer", "vit_large_patch32_224.orig_in21k": "RuntimeError: Error(s) in loading state_dict for VisionTransformer", - "vit_large_r50_s32": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "vit_small_r26_s32": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "vit_tiny_r_s16": "RuntimeError: Exception from src/inference/src/cpp/core.cpp:90: Training mode of BatchNormalization is not supported.", - "volo_": "torch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::col2im' to ONNX opset version 14 is not supported.", + "volo_": "RuntimeError: Exception from src/core/src/dimension.cpp:227: Cannot get length of dynamic dimension", } SUPPORTED_BUT_FAILED_BY_WB_MODELS = { - "convformer": "Cannot find output backbone_node in auto mode, please provide target_layer.", "swin": "Only two outputs of the between block Add node supported, but got 1. Try to use black-box.", + "vit_base_patch16_rpn_224": "Number of normalization outputs > 1", + "vit_relpos_medium_patch16_rpn_224": "ValueError in openvino_xai/methods/white_box/recipro_cam.py:215", } NOT_SUPPORTED_BY_WB_MODELS = { @@ -103,7 +86,6 @@ "tnt_s_patch16_224": "Only two outputs of the between block Add node supported, but got 1.", "twins": "One (and only one) of the nodes has to be Add type. But got ShapeOf and Transpose.", # work in CNN mode -> "visformer": "Cannot find output backbone_node in auto mode, please provide target_layer", - "vit_relpos_medium_patch16_rpn_224": "ValueError in openvino_xai/methods/white_box/recipro_cam.py:215", } From be105eeeca209d1aec8f91bbd70e730560b6b0bb Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Tue, 6 Aug 2024 15:27:19 +0900 Subject: [PATCH 3/3] Update change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ab6120a..757bffe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Support OpenVINO IR (.xml) / ONNX (.onnx) model file for `Explainer` model * Enable AISE: Adaptive Input Sampling for Explanation of Black-box Models. +* Upgrade OpenVINO to 2024.3.0 ### What's Changed @@ -15,6 +16,7 @@ * Support OV IR / ONNX model file for Explainer by @goodsong81 in https://github.com/openvinotoolkit/openvino_xai/pull/47 * Try CNN -> ViT assumption for IR insertion by @goodsong81 in https://github.com/openvinotoolkit/openvino_xai/pull/48 * Enable AISE: Adaptive Input Sampling for Explanation of Black-box Models by @negvet in https://github.com/openvinotoolkit/openvino_xai/pull/49 +* Upgrade OpenVINO to 2024.3.0 by @goodsong81 in https://github.com/openvinotoolkit/openvino_xai/pull/52 ### Known Issues