Lesson1 Colab untar_data to google drive

#1

The command untar_data download and decompress the data to the path set in config.yml. I wonder how to change that path and make my data available in google drive.
Thanks in advance.

0 Likes

#2

Below codes works for me.

!curl -s https://course.fast.ai/setup/colab | bash
from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)
root_dir = "/content/gdrive/My Drive/"
base_dir = root_dir + 'fastai-v3/'
path = Path(base_dir + 'lesson1')
dest = path
dest.mkdir(parents=True, exist_ok=True)

You might need authorize if it’s the first time to mount your google drive with colab. just follow the instructions when running the code.

then you have to use the variable dest when calling untar_data, like below

path = untar_data(URLs.PETS, dest=dest); path
0 Likes