Browse Source

!9883 Fixbug: rise example bug and benchmarkder=() exectuable

From: @lixiaohui33
Reviewed-by: @wuxuejian,@jonyguo,@lilongfei15
Signed-off-by: @lilongfei15
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
1adadfb0ae
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/explainer/_image_classification_runner.py
  2. +1
    -1
      mindspore/explainer/explanation/_attribution/_perturbation/rise.py

+ 1
- 1
mindspore/explainer/_image_classification_runner.py View File

@@ -167,7 +167,7 @@ class ImageClassificationRunner:
if not explainers: if not explainers:
raise ValueError("Argument explainers is empty.") raise ValueError("Argument explainers is empty.")


if benchmarkers:
if benchmarkers is not None:
check_value_type("benchmarkers", benchmarkers, list) check_value_type("benchmarkers", benchmarkers, list)
if not all(isinstance(ele, AttributionMetric) for ele in benchmarkers): if not all(isinstance(ele, AttributionMetric) for ele in benchmarkers):
raise TypeError("Argument benchmarkers is not list of mindspore.explainer.benchmark .") raise TypeError("Argument benchmarkers is not list of mindspore.explainer.benchmark .")


+ 1
- 1
mindspore/explainer/explanation/_attribution/_perturbation/rise.py View File

@@ -77,7 +77,7 @@ class RISE(PerturbationAttribution):
>>> targets = 5 >>> targets = 5
>>> saliency = rise(inputs, targets) >>> saliency = rise(inputs, targets)
>>> # `targets` can also be a 2D tensor >>> # `targets` can also be a 2D tensor
>>> targets = ms.Tensor([[5], [1]])
>>> targets = ms.Tensor([[5], [1]], ms.int32)
>>> saliency = rise(inputs, targets) >>> saliency = rise(inputs, targets)
""" """




Loading…
Cancel
Save