From b4eb3884cf64ae700457a120e8969f0b8c2ac7df Mon Sep 17 00:00:00 2001 From: William Falcon Date: Thu, 9 Apr 2020 12:42:30 -0400 Subject: [PATCH] workers warning not on windows (#1430) --- pytorch_lightning/trainer/data_loading.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/trainer/data_loading.py b/pytorch_lightning/trainer/data_loading.py index 50e86fd5c7..cddd5f90cd 100644 --- a/pytorch_lightning/trainer/data_loading.py +++ b/pytorch_lightning/trainer/data_loading.py @@ -1,4 +1,5 @@ import warnings +import platform from abc import ABC, abstractmethod from typing import Union, List, Tuple, Callable @@ -75,7 +76,9 @@ class TrainerDataLoadingMixin(ABC): raise ValueError(msg) def _worker_check(self, dataloader: DataLoader, name: str) -> None: - if isinstance(dataloader, DataLoader) and dataloader.num_workers <= 2: + on_windows = platform.system() == 'Windows' + + if isinstance(dataloader, DataLoader) and dataloader.num_workers <= 2 and not on_windows: warnings.warn(f'The dataloader, {name}, does not have many workers which may be a bottleneck.' ' Consider increasing the value of the `num_workers` argument`' ' in the `DataLoader` init to improve performance.')