Skip to content

Commit e0c6dae

Browse files
author
um1
committed
add drop-last to avoid 1 batch.
1 parent a5d88a4 commit e0c6dae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
data_transforms['val'])
172172

173173
dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x], batch_size=opt.batchsize,
174-
shuffle=True, num_workers=2, pin_memory=True,
174+
shuffle=True, num_workers=2, pin_memory=True, drop_last=True,
175175
prefetch_factor=2, persistent_workers=True) # 8 workers may work faster
176176
for x in ['train', 'val']}
177177
# Use extra DG-Market Dataset for training. Please download it from https://github.com/NVlabs/DG-Net#dg-market.
@@ -184,7 +184,7 @@
184184
image_datasets['DG'] = DGFolder(os.path.join('../DG-Market' ),
185185
data_transforms['train'])
186186
dataloaders['DG'] = torch.utils.data.DataLoader(image_datasets['DG'], batch_size = max(8, opt.batchsize//2),
187-
shuffle=True, num_workers=2, pin_memory=True)
187+
shuffle=True, num_workers=2, drop_last=True, pin_memory=True)
188188
DGloader_iter = enumerate(dataloaders['DG'])
189189

190190
dataset_sizes = {x: len(image_datasets[x]) for x in ['train', 'val']}

0 commit comments

Comments
 (0)