mirror of
https://github.com/open-mmlab/mmengine.git
synced 2025-06-03 21:54:44 +08:00
[Fix] Fix compatibility of persistent_workers. (#379)
This commit is contained in:
parent
6bd548d8bb
commit
16ef54c45d
@ -1382,6 +1382,13 @@ class Runner:
|
||||
else:
|
||||
init_fn = None
|
||||
|
||||
# `persistent_workers` requires pytorch version >= 1.7
|
||||
if ('persistent_workers' in dataloader_cfg
|
||||
and digit_version(TORCH_VERSION) < digit_version('1.7.0')):
|
||||
warnings.warn('`persistent_workers` is only available when '
|
||||
'pytorch version >= 1.7')
|
||||
dataloader_cfg.pop('persistent_workers')
|
||||
|
||||
# The default behavior of `collat_fn` in dataloader is to
|
||||
# merge a list of samples to form a mini-batch of Tensor(s).
|
||||
# However, to make this more flexible, collate_fn in MMengine does
|
||||
|
Loading…
x
Reference in New Issue
Block a user