Lesson 2: ImageClassifierCleaner - Error Displaying Widget

Is there a solution to using ImageClassifierCleaner yet?

I’ve tried Jupyter Notebook (installed with pip), and Jupyter Lab (installed with conda), on a m1 apple laptop, as well as a desktop with a gpu. In all cases I get an “Error displaying widget” after the ImageClassifierCleaner presumably ran without error, and will simply not display the images and prompts to allow me to jettison high loss images.

Using Google Colab, it works fine, however it’s also extremely slow, and the “use local runtime option” appears to only utilize the desktops CPU, instead of using the GPU

Surely someone has figured out how to get FastAI’s widgets running on a local Jupyter Notebook/Lab instance? Perhaps do I need to drop back to a specific version with a custom pip requirements file?

1 Like

My first try on my local pc gave me errors. I looked at the error messages and they told me what file was giving the problems and I was able to do a pip install --upgrade in regards to the ImageClassifier among other errors that happened the first time running the jupyter notebooks. Share your Error Message here?

I found a fix for this, with the help of another response in fast.ai forums: Open the notebook in JupyterLabs while running on Paperspace.

Here’s how I got there…

I have been having problems with Lesson 2 in multiple environments, including VS Code on my Mac, PC (Windows), PC (WSL), and Paperspace. In each case I have been getting different Python errors in different locations. Paperspace seemed to work the most reliably overall, but I encountered the ImageClassifierCleaner bug there (i.e. JavaScript errors displaying widgets). I tried upgrading and downgrading different Python libraries thinking I just needed to find the right combo of library versions, but that didn’t fix anything and probably made things worse. (I ended up doing a clean Python + fastbook install on my Mac to make sure things were stable.)

None of this was working, and I came across a forum post from @evanemolo (ImageClassifierCleaner UI doesn’t update - Part 1 2022 - fast.ai Course Forums) that recommends opening the notebook in a JupyterLab notebook. This is an option on the left side of your Paperspace window. Everything works after I did this. Apparently the default Paperspace notebook has some things that don’t play nice with fastbook.

Seems like the fastbook repo needs some love to make it more reliable in different environments.