File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1414_PACKAGE_ROOT = os .path .dirname (_EXAMPLES_ROOT )
1515_DATASETS_PATH = os .path .join (_PACKAGE_ROOT , 'Datasets' )
1616
17- _TORCHVISION_MNIST_AVAILABLE = not bool (os .environ . get ("PL_USE_MOCKED_MNIST" , False ))
17+ _TORCHVISION_MNIST_AVAILABLE = not bool (os .getenv ("PL_USE_MOCKED_MNIST" , False ))
1818_DALI_AVAILABLE = _module_available ("nvidia.dali" )
1919
2020if _TORCHVISION_MNIST_AVAILABLE :
2323 MNIST (_DATASETS_PATH , download = True )
2424 except HTTPError :
2525 _TORCHVISION_MNIST_AVAILABLE = False
26+ except RuntimeError as e :
27+ # `torchvision` can produce the following error randomly.
28+ # File "/usr/local/lib/python3.7/dist-packages/torchvision/datasets/utils.py", line 145, in download_url
29+ # raise RuntimeError("File not found or corrupted.")
30+ if "File not found" not in e :
31+ raise
32+ _TORCHVISION_MNIST_AVAILABLE = False
2633
2734LIGHTNING_LOGO = """
2835 ####
You can’t perform that action at this time.
0 commit comments