From e55e2241318fdd1b8048b008c3a790cb20cbacda Mon Sep 17 00:00:00 2001 From: Double_V Date: Fri, 11 Dec 2020 21:07:43 +0800 Subject: [PATCH] set use_shared_momery as False when eval (#1394) --- ppocr/data/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ppocr/data/__init__.py b/ppocr/data/__init__.py index 2f95b377..7b0faf12 100644 --- a/ppocr/data/__init__.py +++ b/ppocr/data/__init__.py @@ -67,6 +67,7 @@ def build_dataloader(config, mode, device, logger): drop_last = loader_config['drop_last'] num_workers = loader_config['num_workers'] + use_shared_memory = False if mode == "Train": #Distribute data to multiple cards batch_sampler = DistributedBatchSampler( @@ -74,6 +75,7 @@ def build_dataloader(config, mode, device, logger): batch_size=batch_size, shuffle=False, drop_last=drop_last) + use_shared_memory = True else: #Distribute data to single card batch_sampler = BatchSampler( @@ -87,6 +89,7 @@ def build_dataloader(config, mode, device, logger): batch_sampler=batch_sampler, places=device, num_workers=num_workers, - return_list=True) + return_list=True, + use_shared_memory=use_shared_memory) return data_loader -- GitLab