Issue in 01_intro colab

Possible solution… for colab users

Hope somone will find this helpful.
For some reason, the upload button doesn’t upload the “chapter1_cat_example.jpg” to the directory. So I manually uploaded the images to the ‘images’ directory and changed the path.

1 Like

Thanks very much. It actually helped :ok_hand:

The reason the upload button doesn’t upload the file to local or colab filesystems is because FileUpload only loads the file into memory, never writing it to disk. Writing the file to disk would require additional code/libraries.

Solved this error by:

  1. Saving a cat image in my google drive
  2. Changing ‘img = PILImage.create(‘images/chapter1_cat_example.jpg’) to ‘img = PILImage.create(‘gdrive/MyDrive/cat-1.jpg’)

In colab, the pwd (present working directory) seems to be /content. Click on the ‘Files’ tab in the left sidebar in colab to navigate the directory structure. I find that my google drive is mapped to /content/gdrive.

thank you this worked on google colab it seems that line of code is not supposed to run