diff --git a/ultralytics/models/yolo/detect/train.py b/ultralytics/models/yolo/detect/train.py index 65b7efff2..27d172b2e 100644 --- a/ultralytics/models/yolo/detect/train.py +++ b/ultralytics/models/yolo/detect/train.py @@ -60,7 +60,7 @@ class DetectionTrainer(BaseTrainer): if self.args.multi_scale: imgs = batch["img"] sz = ( - random.randrange(self.args.imgsz * 0.5, self.args.imgsz * 1.5 + self.stride) + random.randrange(int(self.args.imgsz * 0.5), int(self.args.imgsz * 1.5 + self.stride)) // self.stride * self.stride ) # size