From e0ad4dbef8e6edb60a25a107ff896f4bbce6b335 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Thu, 20 May 2021 11:27:27 +0800 Subject: [PATCH] fix shm check failed in windows/Mac system (#3069) --- ppdet/data/reader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ppdet/data/reader.py b/ppdet/data/reader.py index f080f62c5..144a84d45 100644 --- a/ppdet/data/reader.py +++ b/ppdet/data/reader.py @@ -180,7 +180,10 @@ class BaseDataLoader(object): else: self._batch_sampler = batch_sampler - use_shared_memory = self.use_shared_memory + # DataLoader do not start sub-process in Windows and Mac + # system, do not need to use shared memory + use_shared_memory = self.use_shared_memory and \ + sys.platform not in ['win32', 'darwin'] # check whether shared memory size is bigger than 1G(1024M) if use_shared_memory: shm_size = _get_shared_memory_size_in_M() -- GitLab