Reputation: 37
Code:
from google.colab import drive
import zipfile
drive.mount('/content/gdrive/')
DATA_PATH = '/content/gdrive/MyDrive/Colab Notebooks/'
import os
zf = zipfile.ZipFile(DATA_PATH+"PetImages", "r")
zf.extractall(DATA_PATH)
I am 100% sure the path is correct, but it gives me a IsADirectoryError
.
The folder is split in two mini-folders, cats and dogs.
Upvotes: 1
Views: 398
Reputation: 640
Is /content/gdrive/MyDrive/Colab Notebooks/PetImages
a ZIP file or is this the folder containing the ZIP file you want to extract?
The error message says that you are not passing a ZIP file but a folder.
So probably:
zf = zipfile.ZipFile(DATA_PATH + "PetImages/images.zip", "r")
zf.extractall(DATA_PATH)
Upvotes: 1