Browse Source

fix issue#I26THC: ValueError when benchmark is set default

tags/v1.1.0
lixiaohui 5 years ago
parent
commit
9f722fb850
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      mindspore/explainer/_runner.py

+ 4
- 3
mindspore/explainer/_runner.py View File

@@ -260,7 +260,7 @@ class ExplainRunner:
now = time()
self._run_exp_step(next_element, exp, imageid_labels, summary)
print(spacer.format("Finish writing {}-th explanation data for {}. Time elapsed: "
"{:.3f} s".format(idx, time() - now, exp.__class__.__name__)), end='')
"{:.3f} s".format(idx, exp.__class__.__name__, time() - now)), end='')
print(spacer.format(
"Finish running and writing explanation data for {}. Time elapsed: {:.3f} s".format(
exp.__class__.__name__, time() - start)))
@@ -322,8 +322,9 @@ class ExplainRunner:
raise ValueError("The third element of dataset should be bounding boxes with shape of "
"[batch_size, num_ground_truth, 4].")
else:
if True in [isinstance(bench, Localization) for bench in benchmarkers]:
raise ValueError("The dataset must provide bboxes if Localization is to be computed.")
if benchmarkers is not None:
if True in [isinstance(bench, Localization) for bench in benchmarkers]:
raise ValueError("The dataset must provide bboxes if Localization is to be computed.")

if len(next_element) == 2:
inputs, labels = next_element


Loading…
Cancel
Save