From 02c63ef81cf98b28b10344fe2cce08a03b143941 Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Wed, 8 Jul 2020 10:08:30 +0700 Subject: [PATCH] Add drop_last for multi gpu --- utils/datasets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/datasets.py b/utils/datasets.py index b01201f46dd3..2a9c961e7c3b 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -60,6 +60,7 @@ def create_dataloader(path, imgsz, batch_size, stride, opt, hyp=None, augment=Fa batch_size=batch_size, num_workers=nw, sampler=train_sampler, + drop_last=(train_sampler is not None), pin_memory=True, collate_fn=LoadImagesAndLabels.collate_fn) return dataloader, dataset