TF1_C2W3 Cannot download Horses vs Humans Data

I am attempting to run the cell below the import cell in the assignment workbook, the one that downloads the dataset and extracts it" but I get the following error when doing so:

Access denied with the following error:

Cannot retrieve the public link of the file. You may need to change
the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:

 https://drive.google.com/uc?id=1onaG42NZft3wCE1WH0GDEbUhu75fedP5 

Downloading…
From: https://drive.google.com/uc?id=1LYeusSEIiZQpwN-mthh5nKdA75VsKG1U
To: /content/validation-horse-or-human.zip
100% 11.5M/11.5M [00:00<00:00, 112MB/s]

FileNotFoundError Traceback (most recent call last)
in ()
6
7 test_local_zip = ‘./horse-or-human.zip’
----> 8 zip_ref = zipfile.ZipFile(test_local_zip, ‘r’)
9 zip_ref.extractall(’/tmp/training’)
10

/usr/lib/python3.7/zipfile.py in init(self, file, mode, compression, allowZip64, compresslevel)
1238 while True:
1239 try:
→ 1240 self.fp = io.open(file, filemode)
1241 except OSError:
1242 if filemode in modeDict:

FileNotFoundError: [Errno 2] No such file or directory: ‘./horse-or-human.zip’

Seems like a cloud permissions problem but I am not sure, anyone know how to fix this?

2 Likes

This is an issue. @Community-Team please fix the permission error.

Till then, you can download from the direct link Google Drive - Virus scan warning as per the warning message.

Is there a workaround for this in Colab? My personal machine isn’t the best for training CNNs. Tends to run better and faster in Colab.

  1. Download the zip to your local system.
  2. Upload the file to your google drive
  3. Mount your drive on colab and use the file.

Mounting the drive seems to just completely freeze up the colab notebook

That’s odd. In that case:

  1. Download the zip file to your desktop.
  2. On google colab, pick the files tab (in the left pane)
  3. Drop the zip file
  4. You should see something like this for your training data (I’ve shown it for validation data in the image).

Hi everyone! Thank you for reporting! We are now aware of the issue and working on a fix. Please watch this thread for updates. Thanks again!

Hi everyone! Here is a workaround while we’re fixing the autograder:

Step 1. Create and run these two code cells after the imports:

Code Cell 1:

%%writefile download.sh

#!/bin/bash
fileid="1onaG42NZft3wCE1WH0GDEbUhu75fedP5"
filename="horse-or-human.zip"
html=`curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}"`
curl -Lb ./cookie "https://drive.google.com/uc?export=download&`echo ${html}|grep -Po '(confirm=[a-zA-Z0-9\-_]+)'`&id=${fileid}" -o ${filename}


Code Cell 2:

# NOTE: Please only run this if downloading with gdown did not work.
# This will run the script created above.
!bash download.sh

Step 2. Delete this line in the next code cell that downloads the dataset:

!gdown --id 1onaG42NZft3wCE1WH0GDEbUhu75fedP5

It should look like this and you can run it to download the validation set and extract the zipfiles:

# Get the Horse or Human validation dataset
!gdown --id 1LYeusSEIiZQpwN-mthh5nKdA75VsKG1U

test_local_zip = './horse-or-human.zip'
zip_ref = zipfile.ZipFile(test_local_zip, 'r')
zip_ref.extractall('/tmp/training')

val_local_zip = './validation-horse-or-human.zip'
zip_ref = zipfile.ZipFile(val_local_zip, 'r')
zip_ref.extractall('/tmp/validation')

zip_ref.close()

Step 3. When you see that the unzip is successful, delete Code Cell 1 and 2 that you created in Step 1. This is important. If you leave them there, the grader will throw an error re: invalid syntax.

Step 4. Do the rest of the assignment and submit! You should be able to get a grade.

Hope this also works for you while we’re resolving the current issue. Thank you!

3 Likes

thank you, it works :slightly_smiling_face: :slightly_smiling_face:

2 Likes

We just migrated the dataset to GCP so this should be solved but please let us know if you encounter any issues :slight_smile:

1 Like

i have not been able to get this done

Hi Dwarakesh! Welcome to Discourse! Please reopen the notebook from the classroom to see the changes. Make sure that you’re referring to the same notebook though. This thread is about the TF1 C2 W3 assignment. If you’re referring to a different notebook, kindly create a new topic in the correct week and please mention the lab name. Thanks!

1 Like