From 1d11af72acfa449a2632a2f4da3e7a9fc5b8f171 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 27 Jan 2021 15:01:41 +0800 Subject: [PATCH] fix shuffle not work --- ppocr/data/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppocr/data/__init__.py b/ppocr/data/__init__.py index ea27a865..4809886b 100644 --- a/ppocr/data/__init__.py +++ b/ppocr/data/__init__.py @@ -65,6 +65,7 @@ def build_dataloader(config, mode, device, logger, seed=None): loader_config = config[mode]['loader'] batch_size = loader_config['batch_size_per_card'] drop_last = loader_config['drop_last'] + shuffle = loader_config['shuffle'] num_workers = loader_config['num_workers'] if 'use_shared_memory' in loader_config.keys(): use_shared_memory = loader_config['use_shared_memory'] @@ -75,14 +76,14 @@ def build_dataloader(config, mode, device, logger, seed=None): batch_sampler = DistributedBatchSampler( dataset=dataset, batch_size=batch_size, - shuffle=False, + shuffle=shuffle, drop_last=drop_last) else: #Distribute data to single card batch_sampler = BatchSampler( dataset=dataset, batch_size=batch_size, - shuffle=False, + shuffle=shuffle, drop_last=drop_last) data_loader = DataLoader( -- GitLab