ImageCleaner doesn't render

I tried to use ImageCleaner to clean my dataset, like so:
ImageCleaner(ds, idxs, path)

but this is what I got:

HBox(children=(VBox(children=(Image(value=b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00d\x00d\x00\x00\xff…
Button(button_style='primary', description='Next Batch', layout=Layout(width='auto'), style=ButtonStyle())
<fastai.widgets.image_cleaner.ImageCleaner at 0x7f4f54319400>

I tried reading the source code for ImageCleaner but I’m not a jupyter expert and haven’t managed to figure out what I am doing wrong. Thanks for any pointers on how to fix.

2 Likes

Some other thread suggested restarting the notebook after trusting it. I tried that and that did the trick.

2 Likes

I’m encountering this problem too.
Currently using GCP on MacOS Firefox.
I’ve tried trusting and restarting the notebook but it still doesn’t work.
There was a suggestion to update the fastai package but it’s already on 1.0.42.
Any suggestions on how to debug or fix? Thanks

1 Like

I was experiencing the same thing on GCP, so I opened an issue on GitHub about this: #1539. We’ll have to wait and see.

I was running the notebook on my local linux server, so can’t really comment about GCP. Hope you find a fix,

Following the issue on #1539, the widget is not supported on Jupyter Lab, but will work on Jupyter Notebooks (localhost:8080/tree).

Thanks to @amqdn for raising the issue and @fpingham for the solution.

4 Likes

Hi all,
I ran into a problem with ImageCleaner with the lesson2-download.ipynb [Cleaning Up section] running on Crestle.ai but it had a different error from the other errors above.
I ran

conda update conda
conda install -c fastai fastai

at the start and restarted my kernel to make sure I got the latest fastai libraries. I also did a

git pull

to make sure I got the latest notebooks (as of Feb 24, 2019).

I haven’t investigated it deeply but it looks to me like it might be a bug (see screenshot below).

Has anyone run the ImageCleaner on Crestle.ai
successfully recently?

Best regards,
Butch

1 Like

What do you mean by “trusting” the notebook?

Hi, I have successfully run these 2 lines of code in google colab:

  1. from fastai.widgets import *
  2. ds, idxs = DatasetFormatter().from_toplosses(learn, ds_type=DatasetType.Valid)

But the next line of code is just not completing running or getting ended due to getting disconnected.

ImageCleaner(ds, idxs, path)

Anyone know why this is happening plzz?

1 Like

jupyter trust notebook-name.ipynb

Hi @cg123,

ImageCleaner doesn’t work in colab. See this thread.

As an alternative, you can try this method which is what I did.

HTH.

Butch

2 Likes

Thnx for the info butch, actually I thought of doing the same. And already started doing it. But, got anew pb of getting blank jupyter notebook yesterday after installing it. maybe I need to re-install it again and try it once more. @butchland

I’m getting the same error in crestle.ai. Any update?

If you use GCP, enter this url
http://localhost:8080

I am running notebook on laptop as there was a suggestion that ImageCleaner will not work on Colab. However ImagCleaner does not render but produce following output:

HBox(children=(VBox(children=(Image(value=b’\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00d\x00d\x00\x00\xff…

Button(button_style=‘primary’, description=‘Next Batch’, layout=Layout(width=‘auto’), style=ButtonStyle())

Out[26]:

<fastai.widgets.image_cleaner.ImageCleaner at 0x26096730160>

Looks like an issue with some missing package of Jupyter notebook.
Any suggestions?

2 Likes

I have the same problem.

1 Like

I use Salamander, and got them same output as this. So did you solve it?

1 Like

In the imagecleaner.py file I changed ‘cpu’ to ‘cuda’ and it just took a long time to showcase 6800 images. Although I would’ve only been interested in seeing images that were misclassified.

Same problem…

I didn’t run the notebook in colab or jupyter lab…

finally i solved this problem(If that happened on mac or windows) by running these codes in the terminal:

# for mac terminal, use the command below; for windows cmd, add '--user' to the end of each command.

###  First, reinstall ipywidgets and widgetsnbextension 
pip install --upgrade --force-reinstall ipywidgets

pip install --upgrade --force-reinstall widgetsnbextension 

### Second, install jupyter-js-widgets/extension
jupyter nbextension install --py widgetsnbextension

### Third, enable  widgetsnbextension
jupyter nbextension enable --py widgetsnbextension --sys-prefix

now, we can enjoy lesson2_download.ipynb again. Simply type jupyter notebook in the terminal and open it in the browser.

more details: https://github.com/fastai/fastai/issues/1539

1 Like