Aviad
(Aviad Rabinowich)
1
Hi,
I’m trying to download the mnist_sample by calling:
path = untar_data(URLs.MNIST_SAMPLE)
However, I get the following error:
FileExistsError: [Errno 17] File exists: ‘/storage/data/mnist_sample’
I then try to call:
path.ls()
but get the following error:
NameError: name ‘path’ is not defined
I will appreciate any help!
thanks!
Hi Aviad, I don’t know the error but if your using colab means following method works fine for your error
- Upgrade the fastai by-
!pip install fastai --upgrade
- And import the fastai vision library-
from fastai.vision.all import *
- And the then untar_dara
path = untar_data(URLs.MNIST_SAMPLE)
4.Check the directories
path.ls()
Aviad
(Aviad Rabinowich)
3
Thank you for your reply. I’m using gradient; although I tried your suggestion, it still doesn’t work.
Tanks,
Aviad
bencoman
(Ben Coman)
4
path is not-defined since untar_data() did not complete successfully to return a value to fall into path.
That might indicate that you had previously downloaded the dataset.
To get a view of storage, try all these
!ls
!ls .fastai
!ls /tmp/.fastai
untar_data() is defined here. I’m not familiar with its use in practice, but you might try force_download.
Or otherwise, once you can see where the dataset already downloaded, you might try something like…
from pathlib import Path
path = Path('yourPathToMnist')
Aviad
(Aviad Rabinowich)
5
Thanks everyone, it worked using this line:
path = untar_data(URLs.MNIST_SAMPLE, c_key=‘archive’, force_download=True)
1 Like