ImageClassifierCleaner works on jupyter notebook, not lab

In the hopes this helps someone else, I just figured out that ImageClassifierCleaner seems to work as expected when run from jupyter notebook, but does not run from jupyter lab. In jupyter lab, the pictures print out, but no widgets pop up.

I didn’t expect there would be a distinction, but that’s what I’m seeing. Perhaps there are jupyter lab instructions that I missed?

I’m running locally on Ubuntu 20.04.

> jupyter notebook --version
6.0.3
> jupyter lab --version
2.1.5

>>> fastbook.__version__
'0.0.13'
>>> fastai.__version__
'2.0.15'

Jupyter Lab seems to need some other dependencies for widgets etc. to work, e.g. nodejs.

My Ubuntu build script had the following (not sure if all of them are needed!), and things seem to work in Jupyter Lab:

pip3 install ipywidgets
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager

Yijin

2 Likes