diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index 896f89b9..93c5fa07 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -543,7 +543,7 @@ class AutoBackend(nn.Module): if integer: scale, zero_point = output["quantization"] x = (x.astype(np.float32) - zero_point) * scale # re-scale - if x.ndim > 2: # if task is not classification + if x.ndim == 3: # if task is not classification, excluding masks (ndim=4) as well # Denormalize xywh by image size. See https://github.com/ultralytics/ultralytics/pull/1695 # xywh are normalized in TFLite/EdgeTPU to mitigate quantization error of integer models x[:, [0, 2]] *= w