Using Codelab from Google

Hi,
Congratulations for your job.

I’m trying to begin the course using Codelabs from Google, but I got this message:

Failed to display Jupyter Widget of type HBox.

If you’re reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.

If you’re reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn’t currently support widgets.

Blockquote

How can I solve it?

Thanks.

I get that error too. But I’m able to run the code anyway.

But It seems to be very slow when it’s calculating every epoch doesn’t it?

@kairos What’s your GPU (or what server are you running it on)? It will be relative to the speed of it. I have a GTX 970 and mine runs faster than the lecture.

I fixed this by downgrading ipywidgets to 6.0.0 as found in a GitHub issues post elsewhere:

conda install -c conda-forge ipywidgets=6.0.0

1 Like

I’m using Codlab from Google and I think there isn’t a way of running that command…

conda install -c conda-forge ipywidgets=6.0.0

But thank you any way.

on colab run:

!pip install ipywidgets=6.0.0

it doesn’t completely eliminate it though, but reduces to a short:

Widget Javascript not detected. It may not be installed or enabled properly.

instead of the long:

Failed to display Jupyter Widget of type HBox.

If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.

If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.

I had the same problem on Ubuntu and had already tried conda installing ipywidgets, to no effect.
Specifying the version did the trick. Thank you

Yes, I am trying to do the same.
Here are several things I run into and noticed

  • The GPU in Colab might not have enough memory and I have to reduce the size
  • It runs slowly comparing to the text in the lesson
  • I got the same error for Jupyter Widget but it does not affect running the code

About the error “Failed to display Jupyter Widget of type HBox.”, you can try to disable this checkbox like the image below:
image