File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
pytorch_lightning/trainer Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import warnings
2+ import platform
23from abc import ABC , abstractmethod
34from 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.' )
You can’t perform that action at this time.
0 commit comments