Changing dataset save location

I have been trying to solve this issue for 6 hours now, so if anyone has any suggestions, I would really appreciate it.

Brief version:

  • Is there a way to change the save location for untar_data(URLs.PETS)?

More detailed summary:

  • I installed Anaconda to my large hard drive (G:)
  • Although I installed it here, Jupyter Notebook’s local directory is set to my small C: drive for some reason (this also caused a huge headache)
  • I was able to alter the .jupyter folder configuration file to set the Jupyter Notebook home directory to my G: drive
  • When checking os.getcwd() on jupyter notebook, the directory is on the correct drive (G:)
  • However, when I download the PETS dataset for Lesson 1, it creates a .fastai folder on my C: drive and saves there…

I have very limited space on my C: drive, so I need to somehow get my datasets to save on my G: drive.

Any advice?

Pass in dest parameter to untar_data. So in your case untar_data(URLs.PETS, dest=".") would do, it will save the data in the exact same directory as your notebook. You can pass in another absolute path as well if you like.

Side Note: You should try using shift+tab inside the parentheses of a function call to see what all parameters you can pass. It will show the docstring as well. Jeremy mentions this in the very first lesson I think. Also, it works with any function call in jupyter notebook, so not only with fastai.

Even when I do this, it still saves in my C: drive. My code is

path = untar_data(URLs.PETS, dest="G:/course-v3-master");

I have tried all types of forward and backslashes, and nothing will work. It always creates a .fastai folder with the data in my C: drive :frowning:

I tried it out before posting (on linux). Not sure why it isn’t working for you. You sure it isn’t the old one which was downloaded earlier? Can you delete that and run once again. btw the correct way to write a path in windows is D:\some_folder, Once try using . as well.

1 Like

It is solved now. Thank you so much for your help with this! I really appreciate it

1 Like
untar_data() got an unexpected keyword argument 'dest'

I get this error. Can I not use dest argument?