Browse Source

acc

tags/v1.0.0alpha
MorningForest 3 years ago
parent
commit
3e2960627a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      fastNLP/core/metrics/accuracy.py

+ 1
- 1
fastNLP/core/metrics/accuracy.py View File

@@ -64,7 +64,7 @@ class Accuracy(Metric):
if np.prod(pred.shape) != np.prod(target.shape): if np.prod(pred.shape) != np.prod(target.shape):
raise RuntimeError(f"when pred have same dimensions with target, they should have same element numbers." raise RuntimeError(f"when pred have same dimensions with target, they should have same element numbers."
f" while target have shape:{target.shape}, " f" while target have shape:{target.shape}, "
f"pred have shape: {target.shape}")
f"pred have shape: {pred.shape}")


elif pred.ndim == target.ndim + 1: elif pred.ndim == target.ndim + 1:
pred = pred.argmax(axis=-1) pred = pred.argmax(axis=-1)


Loading…
Cancel
Save