widgets.FileUpload() not working

When executing course 4’s “01_intro.ipynb” notebook , code :
uploader = widgets.FileUpload()
uploader
Result is : “FileUpload(value={}, description=‘Upload’)
I have imported that fastai using
conda install -c fastai -c pytorch fastai
also
conda install graphviz
also
conda install -c conda-forge/label/gcc7 python-utils

This is running on Windows 10 on my PC.
But file upload widget is not working. Any suggestions? Thanks…

1 Like

It worked for me with following.

!pip install ipywidgets

from ipywidgets import *

This is unfortunately also not working for me. I can see in the upload widget it increments to a higher number, however, there is no data inside it that I can see.

I am using a fresh google AI notebook server

This is returned for:
print(uploader)
FileUpload(value={}, description=‘Upload’)

This is returned for:
uploader.data[0]

IndexError Traceback (most recent call last)
in
----> 1 uploader.data[0]

IndexError: list index out of range

Any help would be greatly helpful. I can manually upload images to my folders, but seemingly unable to access the uploader widget variable.

1 Like

Also, I did try the above to install ipwidgets and tried to import as well

Hi, This does not work in Jupyterlab, it works in Jupter Notebook. It worked for me. This is the simplest solution rather than getting stuck in the under the hood code of the notebooks. Best of luck. Inayat

1 Like

It works for me wit datacrunch.io but it doesn’t work for google ai notebooks which is what I would prefer.

I also tried it via classic notebook mode vs JupyterLab and it still does not work.

Facing the same issue with a Jupyter lab notebook on gcp. Has anyone found a solution here?

According to installation instructions in ipywidgets docs you need to have node.js installed and install the labextension:

jupyter labextension install @jupyter-widgets/jupyterlab-manager@2.0

2.0 in the end is for jupyterlab version 2.x
This worked for me on a local machine, may be it helps on gcp

Were you able to resolve this. It was working perfectly in paperspace/gradient. I then switched to GCP and uploader just doesn’t work.

Nope. I used paperspace for the first two lessons.

Thanks. I’ll do the same. I actually came to GCP from Paperspace because it was getting impossible to connect to Paperspace on to free GPUs when their servers get busy. .

Hi Inayat, how do you get to Jupyter Notebook from GCP’s AI Notebook GUI? Thanks so much.

This doesn’t work for me. I tried this:
jupyter labextension install @jupyter-widgets/jupyterlab-manager
and that doesn’t work either. I got the above from the ipywidgets documentation page https://ipywidgets.readthedocs.io/en/stable/user_install.html

Is anyone else running into this too?

1 Like

Also didn’t work for me.

1 Like

I am running my Juypter Notebooks directly on my server and not GCP.

I couldn’t find an answer to this on this forum, but an easy work-around is to upload your image(s) to the notebook’s /images dir, and then edit the code in cell #21, uploader = SimpleNamespace(data = ['images/your-filename-here'). Hope this helps.