Skip to content

Commit

Permalink
workers warning not on windows (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon authored Apr 9, 2020
1 parent 21a1972 commit b4eb388
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytorch_lightning/trainer/data_loading.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import warnings
import platform
from abc import ABC, abstractmethod
from typing import Union, List, Tuple, Callable

Expand Down Expand Up @@ -75,7 +76,9 @@ def _percent_range_check(self, name: str) -> None:
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.')
Expand Down

0 comments on commit b4eb388

Please sign in to comment.