Skip to content

Commit dbe49d1

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Warning for dataset download & extract race condition (#8709)
Summary: Co-authored-by: Nicolas Hug <[email protected]> Reviewed By: vmoens Differential Revision: D68021983 fbshipit-source-id: 3e8cd53279207b1b299163bcd150ff61f605f775
1 parent cb4decc commit dbe49d1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/source/datasets.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ All the datasets have almost similar API. They all have two common arguments:
2727
``transform`` and ``target_transform`` to transform the input and target respectively.
2828
You can also create your own datasets using the provided :ref:`base classes <base_classes_datasets>`.
2929

30+
.. warning::
31+
32+
When a dataset object is created with ``download=True``, the files are first
33+
downloaded and extracted in the root directory. This download logic is not
34+
multi-process safe, so it may lead to conflicts / race conditions if it is
35+
run within a distributed setting. In distributed mode, we recommend creating
36+
a dummy dataset object to trigger the download logic *before* setting up
37+
distributed mode.
38+
3039
Image classification
3140
~~~~~~~~~~~~~~~~~~~~
3241

0 commit comments

Comments
 (0)