ImageClassifierCleaner showing a single image with long scroll bar

Hello!

I’m running into an issue where I’m using the information in chapter 2 of the book to create an image recognition model and when I get to the point where I’m running:

cleaner = ImageClassifierCleaner(learn)
cleaner

I get a new cell with a single image and a large scroll bar. If I scroll to the right on the bar other images will flicker in and out but I can never select them for cleaning. I am running things locally. I’ve tried this in Brave, Chrome, and Edge. I’ve tried using the fastai fast setup with mamba (mambo?), as well as using my own install of things using a virtualenv and pip installing things. I get the same results regardless of using jupyter-lab or jupyter notebook. I’ve tried this both under Windows as well as WSL (I much prefer WSL though since wow it’s so much faster).

The code works as expected on the Kaggle workspace but I have a 4090 on my local machine and training is 5X faster locally than in the cloud so would prefer to be able to use my own machine for it. I can still do the course materials so it’s not a crisis but I would like to be able to clean my data if possible for the model. :smiley:

I’m using Python 3.10.12. I’ve got fastai 2.7.12, jupyterlab 4.0.3, and ipwidgets 8.0.7. I’ve got the latest NPM and Node installed as of two days ago. I’m not seeing any errors and interp.plot_top_losses(5, nrows=1) is showing 5 images correctly.

Here is a picture of what it looks like (I can’t show the flickering as it shows while I’m moving the bar but they hide again when I’m done):

If I can provide any other information to help troubleshoot things I’m happy to do so! Many thanks for any suggestions on what to try next.

Jeremy

When it works on Kaggle are the fastai and ipwidgets versions the same as when it fails locally?

Great suggestion! On Kaggle it’s using fastai 2.7.12, ipywidgets 7.7.1, and jupyterlab 3.6.5. Sadly, if I install all of these (using a new virtualenv for fresh everything) once I get to the point where I run the training:

learn = vision_learner(dls, "resnet34", metrics=error_rate)  # resnet18
learn.fine_tune(10)

I get the following error:

The kernel for Untitled.ipynb appears to have died. It will restart automatically.

and I can’t seem to get past that. I’ve tried different classifier models to see if that might impact it but nothing.

The WSL console doesn’t show any errors, just that the kernel restarted but I do see the following errors in the browser console:

I can still do

interp.plot_top_losses(15, nrows=3)

to at least see what’s going on and try and find bad images so I can at least do some clean up and then retrain once things get removed. Was just hoping there was something easy I might be missing that I just didn’t know yet. :smiley:

Hey Jeremy, I was having the same problem but I managed to fix it by tweaking the jupyter packages version using pip to match the Google Collab version. My local machine is running on Fedora 38. The following is my requirements.txt.

aiofiles==22.1.0
aiohttp==3.8.5
aiosignal==1.3.1
aiosqlite==0.19.0
annotated-types==0.5.0
anyio==3.7.1
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
async-lru==2.0.4
async-timeout==4.0.3
attrs==23.1.0
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.2
bleach==6.0.0
blis==0.7.10
catalogue==2.0.9
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==3.2.0
click==8.1.6
cmake==3.27.2
comm==0.1.4
confection==0.1.1
contourpy==1.1.0
cycler==0.11.0
cymem==2.0.7
datasets==2.14.4
debugpy==1.6.7.post1
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.7
docopt==0.6.2
entrypoints==0.4
executing==1.2.0
fastai==2.7.12
fastbook==0.0.29
fastcore==1.5.29
fastdownload==0.0.7
fastjsonschema==2.18.0
fastprogress==1.0.3
filelock==3.12.2
fonttools==4.42.0
fqdn==1.5.1
frozenlist==1.4.0
fsspec==2023.6.0
graphviz==0.20.1
huggingface-hub==0.16.4
idna==3.4
ipykernel==6.25.1
ipython==7.34.0
ipython-genutils==0.2.0
ipywidgets==7.7.1
isoduration==20.11.0
jedi==0.19.0
Jinja2==3.1.2
joblib==1.3.2
json5==0.9.14
jsonpointer==2.4
jsonschema==4.19.0
jsonschema-specifications==2023.7.1
jupyter-console==6.6.3
jupyter-events==0.7.0
jupyter-lsp==2.2.0
jupyter-ydoc==0.2.5
jupyter_client==7.4.9
jupyter_core==5.3.1
jupyter_server==2.7.1
jupyter_server_fileid==0.9.0
jupyter_server_terminals==0.4.4
jupyter_server_ydoc==0.8.0
jupyterlab==3.6.4
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.7
jupyterlab_server==2.22.1
kiwisolver==1.4.4
langcodes==3.3.0
lit==16.0.6
MarkupSafe==2.1.3
matplotlib==3.7.2
matplotlib-inline==0.1.6
mistune==3.0.1
mpmath==1.3.0
multidict==6.0.4
multiprocess==0.70.15
murmurhash==1.0.9
nbclassic==1.0.0
nbclient==0.8.0
nbconvert==7.7.4
nbformat==5.9.2
nest-asyncio==1.5.7
networkx==3.1
notebook==6.5.4
notebook_shim==0.2.3
numpy==1.25.2
nvidia-cublas-cu11==11.10.3.66
nvidia-cuda-cupti-cu11==11.7.101
nvidia-cuda-nvrtc-cu11==11.7.99
nvidia-cuda-runtime-cu11==11.7.99
nvidia-cudnn-cu11==8.5.0.96
nvidia-cufft-cu11==10.9.0.58
nvidia-curand-cu11==10.2.10.91
nvidia-cusolver-cu11==11.4.0.1
nvidia-cusparse-cu11==11.7.4.91
nvidia-nccl-cu11==2.14.3
nvidia-nvtx-cu11==11.7.91
overrides==7.4.0
packaging==23.1
pandas==2.0.3
pandocfilters==1.5.0
parso==0.8.3
pathy==0.10.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.4.0
pipreqs==0.4.13
platformdirs==3.10.0
preshed==3.0.8
prometheus-client==0.17.1
prompt-toolkit==3.0.39
psutil==5.9.5
ptyprocess==0.7.0
pure-eval==0.2.2
pyarrow==12.0.1
pycparser==2.21
pydantic==2.1.1
pydantic_core==2.4.0
Pygments==2.16.1
pyparsing==3.0.9
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2023.3
PyYAML==6.0.1
pyzmq==25.1.1
referencing==0.30.2
regex==2023.8.8
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.9.2
safetensors==0.3.2
scikit-learn==1.3.0
scipy==1.11.1
Send2Trash==1.8.2
sentencepiece==0.1.99
six==1.16.0
smart-open==6.3.0
sniffio==1.3.0
soupsieve==2.4.1
spacy==3.6.1
spacy-legacy==3.0.12
spacy-loggers==1.0.4
srsly==2.4.7
stack-data==0.6.2
sympy==1.12
terminado==0.17.1
thinc==8.1.12
threadpoolctl==3.2.0
tinycss2==1.2.1
tokenizers==0.13.3
torch==2.0.1
torchvision==0.15.2
tornado==6.3.3
tqdm==4.66.1
traitlets==5.9.0
transformers==4.31.0
triton==2.0.0
typer==0.9.0
typing_extensions==4.7.1
tzdata==2023.3
uri-template==1.3.0
urllib3==2.0.4
wasabi==1.1.2
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.1
widgetsnbextension==3.6.5
xxhash==3.3.0
y-py==0.6.0
yarg==0.1.9
yarl==1.9.2
ypy-websocket==0.8.4

Thanks for that! Sadly, when I try with those I just get Kernel restarted errors with nothing in the console saying why when I try and run learn.fine_tune(10). :frowning: For now I’ll just have to run without this feature I guess. Hopefully there will be some future updates in the packages that fix things!

1 Like

@lanthos did you ever find a solution to this? I’m running into the same problem now and can’t find anyone else with the same problem.

Unfortunately I did not. :frowning: I know that some libraries take longer to update and I’m just hoping that eventually people will run into the same issue and work on the underlying stuff to make it work and update things and it will just start working. :smiley:

I opened a Github issue on it, I have a very similar issue. Maybe comment on there to get it seen :slight_smile: