solaris icon indicating copy to clipboard operation
solaris copied to clipboard

[BUG]: IProgress not found. Please update jupyter & ipywidgets

Open skyprince999 opened this issue 5 years ago • 14 comments

#359 Summary of the bug I am running the tutorials found here - Mapping vehicles & Tiling tutorial

And the code is breaking whenever the tqdm module is called (to show the status bar)!

Steps to reproduce the bug

I am running the mapping cars tutorial & the Tiling tutorial. (Links given above) For the car mapping tutorial the code breaks here -

The error occurs on the following line: trainer = sol.nets.train.Trainer(config)

For the Tiling tutorial the code breaks here -

raster_bounds_crs = raster_tiler.tile('/path/to/raster/file/3band/PS-RGB_mosaic_013022223133.tif')

Buggy behavior and/or error message

The error log had the following: Exception ignored in: <function tqdm.__del__ at 0x7fe617c33290> Traceback (most recent call last): File "/opt/conda/envs/solaris/lib/python3.7/site-packages/tqdm/std.py", line 1087, in __del__ self.close() File "/opt/conda/envs/solaris/lib/python3.7/site-packages/tqdm/notebook.py", line 247, in close self.sp(bar_style='success') AttributeError: 'tqdm_notebook' object has no attribute 'sp'

followed by -

ImportError: IProgress not found. Please update jupyter and ipywidgets.......

Expected behavior

Model should be downloaded, without any issues.

Environment information

  • OS: GNU-Linux, GCP Deep Learning Platform with TF2.1 pre-installed
  • solaris version: 0.3.0
  • python version: 3.7.6
  • tqdm: 4.48.0 I am using Jupyterlab on a GCP VM

Additional context

Hardware: N1 4vCPUs, 15GB RAM (GCP) NVidia Tesla T4

I get the above error while running the following notebook https://github.com/jshermeyer/solaris_cowc/blob/master/map_vehicles_cowc.ipynb

I first got the error while downloading the VGG16 pre-trained weights. So I downloaded the model and then copied it to the required directory. And then again ran the training code. However then I got the error while it was downloading the SpaceNet model weights.

While downloading the weights the error occurs for the status bar. from the get_model >> download_model module.

The same error re-occurred when I was running the Tiling tutorial

Again while running the tqdm module.

I have tried the steps as given in the following SF answer

  • re-installing ipywidgets
  • and enabling widget extensions

skyprince999 avatar Jul 27 '20 13:07 skyprince999

i meet same the error on my juptyer notebook (using docker). i resolve it by changing the notebook dir. if you run jupyter notebook using root dir, using the --notebook-dir to change the dir may help you.

DavidJohn197749 avatar Oct 23 '20 04:10 DavidJohn197749

Thanks, that worked!

koegl avatar Dec 21 '20 01:12 koegl

i meet same the error on my juptyer notebook (using docker). i resolve it by changing the notebook dir. if you run jupyter notebook using root dir, using the --notebook-dir to change the dir may help you.

Sir, my dir is the Desktop. But I meet the same error.

I solved this by chaging

from tqdm.notebook import tqdm as tqdm

to

from tqdm import tqdm

solved this

gaopinghai avatar Jan 13 '21 06:01 gaopinghai

i meet same the error on my juptyer notebook (using docker). i resolve it by changing the notebook dir. if you run jupyter notebook using root dir, using the --notebook-dir to change the dir may help you.

Sir, my dir is the Desktop. But I meet the same error.

I solved this by chaging

from tqdm.notebook import tqdm as tqdm

to

from tqdm import tqdm

solved this

Thanks, PingHGao. Really worked!

ViniMM2 avatar Jul 18 '21 16:07 ViniMM2

If you are using jupyter-lab, try this: jupyter nbextension enable --py widgetsnbextension. Was able to reproduce and fixed issues.

Aleksandar1932 avatar Aug 01 '21 09:08 Aleksandar1932

If you are using jupyter-lab, try this: jupyter nbextension enable --py widgetsnbextension. Was able to reproduce and fixed issues.

Also needed to pip install ipywidgets for this.

AcylSilane avatar Aug 02 '21 20:08 AcylSilane

Reinstalling tqdm solved the issue for me conda install -c conda-forge tqdm

ZSoumia avatar Sep 08 '21 09:09 ZSoumia

i meet same the error on my juptyer notebook (using docker). i resolve it by changing the notebook dir. if you run jupyter notebook using root dir, using the --notebook-dir to change the dir may help you.

Sir, my dir is the Desktop. But I meet the same error. I solved this by chaging

from tqdm.notebook import tqdm as tqdm

to

from tqdm import tqdm

solved this

Thanks, PingHGao. Really worked!

i meet same the error on my juptyer notebook (using docker). i resolve it by changing the notebook dir. if you run jupyter notebook using root dir, using the --notebook-dir to change the dir may help you.

Sir, my dir is the Desktop. But I meet the same error.

I solved this by chaging

from tqdm.notebook import tqdm as tqdm

to

from tqdm import tqdm

solved this

Thank you, PingHGao! It helped and saved my time very much!

python3 --version
Python 3.9.10
# installed at non-standard directory. 

import sys
print("python:", sys.version)
python: 3.9.10 (main, Jan 31 2022, 06:20:15) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

pip3 list | grep -E 'jupyter|ipywidgets|tqdm'
ipywidgets           7.6.5
jupyter              1.0.0
jupyter-client       7.1.2
jupyter-console      6.4.0
jupyter-core         4.9.1
jupyterlab-pygments  0.1.2
jupyterlab-widgets   1.0.2
tqdm                 4.62.3

mickeykawai avatar Feb 12 '22 04:02 mickeykawai

i meet same the error on my juptyer notebook (using docker). i resolve it by changing the notebook dir. if you run jupyter notebook using root dir, using the --notebook-dir to change the dir may help you.

Sir, my dir is the Desktop. But I meet the same error.

I solved this by chaging

from tqdm.notebook import tqdm as tqdm

to

from tqdm import tqdm

solved this

A more flexible way could be:

try:
    import IProgress
    from tqdm.notebook import tqdm
except ImportError:
    from tqdm import tqdm

This will import the widget version of tqdm if widgets are supported, and the console version if not.

scign avatar Feb 27 '23 05:02 scign

I tried to install ipywigdets by 'pip install ipywidgets', and it works for me. No such errors since then.

ZhuoHan1998 avatar Nov 05 '23 18:11 ZhuoHan1998

I'm building my own Docker image from Jupyter's minimal-notebook image. With a 'mamba install ipywidgets', I casafely import tqdm classes from tqdm.notebook.

MewmewWho avatar Nov 16 '23 08:11 MewmewWho

I encountered the same issue: image

with the following packages:

python3 jupyter.py --version
IPython          : 8.18.1
ipykernel        : 6.27.1
ipywidgets       : not installed
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.12.1
jupyterlab       : 4.0.9
nbclient         : 0.9.0
nbconvert        : 7.12.0
nbformat         : 5.9.2
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.14.0

The following packages are not installed directly with pip3 install jupyterlab

ipywidgets       : not installed
notebook         : not installed
qtconsole        : not installed

However, after installing these packages, the issue is resolved: image

pip3 install notebook ipywidgets qtconsole

And here are the installed versions:

IPython          : 8.18.1
ipykernel        : 6.27.1
ipywidgets       : 8.1.1
jupyter_client   : 8.6.0
jupyter_core     : 5.5.1
jupyter_server   : 2.12.1
jupyterlab       : 4.0.9
nbclient         : 0.9.0
nbconvert        : 7.13.0
nbformat         : 5.9.2
notebook         : 7.0.6
qtconsole        : 5.5.1
traitlets        : 5.14.0

fti-sfuke avatar Dec 20 '23 16:12 fti-sfuke

I encountered the same issue: image

with the following packages:

python3 jupyter.py --version
IPython          : 8.18.1
ipykernel        : 6.27.1
ipywidgets       : not installed
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.12.1
jupyterlab       : 4.0.9
nbclient         : 0.9.0
nbconvert        : 7.12.0
nbformat         : 5.9.2
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.14.0

The following packages are not installed directly with pip3 install jupyterlab

ipywidgets       : not installed
notebook         : not installed
qtconsole        : not installed

However, after installing these packages, the issue is resolved: image

pip3 install notebook ipywidgets qtconsole

And here are the installed versions:

IPython          : 8.18.1
ipykernel        : 6.27.1
ipywidgets       : 8.1.1
jupyter_client   : 8.6.0
jupyter_core     : 5.5.1
jupyter_server   : 2.12.1
jupyterlab       : 4.0.9
nbclient         : 0.9.0
nbconvert        : 7.13.0
nbformat         : 5.9.2
notebook         : 7.0.6
qtconsole        : 5.5.1
traitlets        : 5.14.0

thanks bro, problem solved.

GigleGig avatar Apr 29 '24 15:04 GigleGig