Fixed multiscale preprocess_batch (#15392)

This commit is contained in:
Francesco Mattioli 2024-08-12 22:51:06 +02:00 committed by GitHub
parent 63e26e1fc8
commit 592f421663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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