Image cleaner widget breaks google colaboratory?

I’m doing the “homework” from lesson 1 of the 2019 course, and when trying to go through the second notebook I run into an issue when I get to the data cleaning part.

When running the following block:

The notebook simply crashes and disconnects, and I am unable to resume without restarting.

Could this be some kind of mistake on my part? I’ve tried to make it work multiple times to no avail. Has anyone successfully run this notebook on colab?

Here’s a link to the notebook on github: https://github.com/marcospgp/the-strokes-or-the-voidz/blob/master/lesson2_download.ipynb

Thanks!

1 Like

I think the problem is that widgets are not supported in Google Colab.

As you are storing the images in Google Drive you could just go in there and delete some. However the widget is worth a go so I would recommend setting up a local Jupyter environment, connect to your Google Drive and then run the widget. Once you have run the widget a csv is generated. I would recommend then going back to Google Colab to complete the lesson (as it is likely to be faster than your local environment).

5 Likes

Thanks for linking to that thread! I suppose the widgets don’t work in colab then.

I had the same experience, quite frustrating, since I want to play with the function. But I guess it is also better to learn about how to set up the other environments then…

@simonwoodhead
I am using Colab,so went ahead and removed the noisy images from the directories. Now it started erroring in the plot top losses and other functions. So I’m having to go all the way back to the beginning and create a random seed + data bunch.

Is there another way to update the data bunch? Could I make that call later?

Unfortunately it has been a while since I looked at this so I cannot recommend a different way to update the data bunch. The way I actually did it at the time was to set up a local development environment, then use the csv which is created to filter the data.

Could you explain how to do this in detail? I’m using Colab because I don’t have a GPU dedicated machine…

I have encountered this problem too, in fast.ai part 1 v3 lesson2-download. I am currently switching to Paperspace Gradient. As far as I can tell, it is Jupyter Notebook, not JupyterLab (which Google Colab runs on and is incompatible with widgets).

According to this page, JupyterLab is the successor to Notebooks. I have not checked out fastai v2 nor the part 1 v4, which is currently being filmed, so I cannot say how they are dealing with this incompatibility. Perhaps someone who works on the code can comment as to whether the library v2 and the lesson v4 migrates to Lab, or drops Colab support.