Skip to content

Commit b4eb388

Browse files
workers warning not on windows (#1430)
1 parent 21a1972 commit b4eb388

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytorch_lightning/trainer/data_loading.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import warnings
2+
import platform
23
from abc import ABC, abstractmethod
34
from typing import Union, List, Tuple, Callable
45

@@ -75,7 +76,9 @@ def _percent_range_check(self, name: str) -> None:
7576
raise ValueError(msg)
7677

7778
def _worker_check(self, dataloader: DataLoader, name: str) -> None:
78-
if isinstance(dataloader, DataLoader) and dataloader.num_workers <= 2:
79+
on_windows = platform.system() == 'Windows'
80+
81+
if isinstance(dataloader, DataLoader) and dataloader.num_workers <= 2 and not on_windows:
7982
warnings.warn(f'The dataloader, {name}, does not have many workers which may be a bottleneck.'
8083
' Consider increasing the value of the `num_workers` argument`'
8184
' in the `DataLoader` init to improve performance.')

0 commit comments

Comments
 (0)