Lightning-AI / pytorch-lightning

Pretrain, finetune ANY AI model of ANY size on multiple GPUs, TPUs with zero code changes.
https://lightning.ai
Apache License 2.0
28.21k stars 3.37k forks source link

Progress bar not working #11208

Closed OverLordGoldDragon closed 2 years ago

OverLordGoldDragon commented 2 years ago
Training: 0it [00:00, ?it/s]

is all I get, it never changes. I'm using Spyder 5.2.1. Meanwhile this works properly

import sys, time
from tqdm import trange

for j in trange(100, file=sys.stdout, leave=False, unit_scale=True, desc='loop'):
    time.sleep(1)
conda list ``` # packages in environment at D:\Anaconda\envs\pyt: # # Name Version Build Channel absl-py 0.15.0 pyhd8ed1ab_0 conda-forge aiohttp 3.7.4.post0 py38h294d835_1 conda-forge alabaster 0.7.12 py_0 conda-forge anyio 3.3.3 py38haa244fe_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge argh 0.26.2 pyh9f0ad1d_1002 conda-forge argon2-cffi 21.1.0 py38h294d835_0 conda-forge arrow 1.2.0 pyhd8ed1ab_0 conda-forge astroid 2.5.8 py38haa244fe_0 conda-forge async-timeout 3.0.1 py_1000 conda-forge async_generator 1.10 py_0 conda-forge atomicwrites 1.4.0 pyh9f0ad1d_0 conda-forge attrs 21.2.0 pyhd8ed1ab_0 conda-forge audioread 2.1.9 py38haa244fe_0 conda-forge autopep8 1.6.0 pyhd8ed1ab_1 conda-forge babel 2.9.1 pyh44b312d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bcrypt 3.2.0 py38h294d835_1 conda-forge binaryornot 0.4.4 py_1 conda-forge black 21.9b0 pyhd8ed1ab_0 conda-forge blas 1.0 mkl bleach 4.1.0 pyhd8ed1ab_0 conda-forge blinker 1.4 py_1 conda-forge brotli-python 1.0.9 py38h885f38d_5 conda-forge brotlipy 0.7.0 py38h294d835_1001 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge ca-certificates 2021.10.26 haa95532_2 cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge cachetools 4.2.4 pyhd8ed1ab_0 conda-forge certifi 2021.10.8 py38haa244fe_1 conda-forge cffi 1.14.6 py38hd8c33c5_1 conda-forge chardet 4.0.0 py38haa244fe_1 conda-forge charset-normalizer 2.0.0 pyhd8ed1ab_0 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge cloudpickle 2.0.0 pyhd8ed1ab_0 conda-forge colorama 0.4.4 pyh9f0ad1d_0 conda-forge conda 4.11.0 py38haa244fe_0 conda-forge conda-package-handling 1.7.3 py38h31c79cd_1 conda-forge configparser 5.1.0 pyhd8ed1ab_0 conda-forge cookiecutter 1.6.0 py38_1000 conda-forge cryptography 3.4.7 py38hd7da0ea_0 conda-forge cudatoolkit 11.3.1 h59b6b97_2 cupy 9.5.0 py38hf95616d_1 conda-forge cycler 0.10.0 py_2 conda-forge cython 0.29.24 py38h885f38d_0 conda-forge dash 2.0.0 pyhd8ed1ab_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge debugpy 1.4.1 py38h885f38d_0 conda-forge decorator 5.1.0 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge diff-match-patch 20200713 pyh9f0ad1d_0 conda-forge docker-pycreds 0.4.0 py_0 conda-forge docutils 0.17.1 py38haa244fe_0 conda-forge entrypoints 0.3 pyhd8ed1ab_1003 conda-forge fastrlock 0.8 py38h885f38d_1 conda-forge fftw 3.3.10 nompi_hea9a5d6_101 conda-forge flake8 4.0.1 pyhd8ed1ab_1 conda-forge flask 2.0.2 pyhd8ed1ab_0 conda-forge flask-compress 1.10.1 pyhd8ed1ab_0 conda-forge freetype 2.10.4 h546665d_1 conda-forge fsspec 2021.10.1 pyhd8ed1ab_0 conda-forge future 0.18.2 py38haa244fe_3 conda-forge gitdb 4.0.9 pyhd8ed1ab_0 conda-forge gitpython 3.1.24 pyhd8ed1ab_0 conda-forge google-auth 1.35.0 pyh6c4a22f_0 conda-forge google-auth-oauthlib 0.4.6 pyhd8ed1ab_0 conda-forge grpcio 1.41.1 py38he5377a8_1 conda-forge h5py 3.6.0 nompi_py38hde0384b_100 conda-forge hdf5 1.12.1 nompi_h2a0e4a3_103 conda-forge icu 68.1 h0e60522_0 conda-forge idna 3.1 pyhd3deb0d_0 conda-forge imagesize 1.2.0 py_0 conda-forge importlib-metadata 4.2.0 py38haa244fe_0 conda-forge importlib_metadata 4.2.0 hd8ed1ab_0 conda-forge inflection 0.5.1 pyh9f0ad1d_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge intel-openmp 2021.3.0 h57928b3_3372 conda-forge intervaltree 3.0.2 py_0 conda-forge ipykernel 6.4.1 py38h595d716_0 conda-forge ipython 7.28.0 py38h595d716_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.6.5 pyhd8ed1ab_0 conda-forge isort 5.9.3 pyhd8ed1ab_0 conda-forge itsdangerous 2.0.1 pyhd8ed1ab_0 conda-forge jbig 2.1 h8d14728_2003 conda-forge jedi 0.18.0 py38haa244fe_2 conda-forge jellyfish 0.8.9 py38h294d835_2 conda-forge jinja2 3.0.2 pyhd8ed1ab_0 conda-forge jinja2-time 0.2.0 py_2 conda-forge joblib 1.1.0 pyhd8ed1ab_0 conda-forge jpeg 9d h8ffe710_0 conda-forge json5 0.9.6 pyhd3eb1b0_0 jsonschema 4.1.0 pyhd8ed1ab_0 conda-forge jupyter-console 6.4.0 pypi_0 pypi jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_core 4.8.1 py38haa244fe_0 conda-forge jupyter_server 1.11.1 pyhd8ed1ab_0 conda-forge jupyterlab 3.2.1 pyhd8ed1ab_0 conda-forge jupyterlab-server 1.2.0 pypi_0 pypi jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_server 2.8.2 pyhd8ed1ab_0 conda-forge jupyterlab_widgets 1.0.2 pyhd8ed1ab_0 conda-forge keyring 23.2.1 py38haa244fe_0 conda-forge kiwisolver 1.3.2 py38hbd9d945_0 conda-forge krb5 1.19.2 h20d022d_3 conda-forge lazy-object-proxy 1.6.0 py38h294d835_0 conda-forge lcms2 2.12 h2a16943_0 conda-forge lerc 2.2.1 h0e60522_0 conda-forge libarchive 3.5.2 hb45042f_1 conda-forge libblas 3.9.0 11_win64_mkl conda-forge libcblas 3.9.0 11_win64_mkl conda-forge libclang 11.1.0 default_h5c34c98_1 conda-forge libcurl 7.80.0 h789b8ee_1 conda-forge libdeflate 1.7 h8ffe710_5 conda-forge libflac 1.3.3 h0e60522_1 conda-forge libiconv 1.16 he774522_0 conda-forge liblapack 3.9.0 11_win64_mkl conda-forge libmamba 0.19.1 h44daa3b_0 conda-forge libmambapy 0.19.1 py38h2bfd5b9_0 conda-forge libogg 1.3.5 h2bbff1b_1 libopus 1.3.1 h8ffe710_1 conda-forge libpng 1.6.37 h1d00b33_2 conda-forge libprotobuf 3.19.1 h7755175_0 conda-forge librosa 0.8.1 pyhd8ed1ab_0 conda-forge libsndfile 1.0.31 h0e60522_1 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libsolv 0.7.19 h7755175_5 conda-forge libspatialindex 1.9.3 h39d44d4_4 conda-forge libssh2 1.10.0 h680486a_2 conda-forge libtiff 4.3.0 h0c97f57_1 conda-forge libuv 1.40.0 he774522_0 libvorbis 1.3.7 ha925a31_0 conda-forge libxml2 2.9.12 hf5bbc77_1 conda-forge libzlib 1.2.11 h8ffe710_1013 conda-forge llvmlite 0.36.0 py38h57a6900_0 conda-forge lz4-c 1.9.3 h8ffe710_1 conda-forge lzo 2.10 hfa6e2cd_1000 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge mamba 0.19.1 py38hecfeebb_0 conda-forge markdown 3.3.4 pyhd8ed1ab_0 conda-forge markupsafe 2.0.1 py38h294d835_0 conda-forge matplotlib 3.4.3 py38haa244fe_1 conda-forge matplotlib-base 3.4.3 py38h1f000d6_1 conda-forge matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge mccabe 0.6.1 py_1 conda-forge menuinst 1.4.18 py38haa244fe_1 conda-forge mistune 0.8.4 py38h294d835_1004 conda-forge mkl 2021.3.0 hb70f87d_564 conda-forge more-itertools 8.10.0 pyhd8ed1ab_0 conda-forge mpmath 1.2.1 pyhd8ed1ab_0 conda-forge msys2-conda-epoch 20160418 1 conda-forge multidict 5.2.0 py38h294d835_1 conda-forge mypy_extensions 0.4.3 py38haa244fe_3 conda-forge nbclassic 0.3.2 pyhd8ed1ab_0 conda-forge nbclient 0.5.4 pyhd8ed1ab_0 conda-forge nbconvert 5.6.1 pypi_0 pypi nbformat 5.1.3 pyhd8ed1ab_0 conda-forge nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge ninja 1.10.2 h6d14046_1 notebook 6.4.4 pyha770c72_0 conda-forge numba 0.53.0 py38h5c177ec_0 conda-forge numpy 1.21.2 py38h089cfbf_0 conda-forge numpydoc 1.1.0 py_1 conda-forge oauthlib 3.1.1 pyhd8ed1ab_0 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openjpeg 2.4.0 hb211442_1 conda-forge openssl 1.1.1l h8ffe710_0 conda-forge packaging 21.0 pyhd8ed1ab_0 conda-forge pandas 1.3.3 py38h5d928e2_0 conda-forge pandoc 2.14.2 h8ffe710_0 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge paramiko 2.7.2 pyh9f0ad1d_0 conda-forge parso 0.8.2 pyhd8ed1ab_0 conda-forge pathspec 0.9.0 pyhd8ed1ab_0 conda-forge pathtools 0.1.2 py_1 conda-forge pdfkit 0.6.1 pypi_0 pypi pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 8.3.2 py38h794f750_0 conda-forge pip 21.2.4 pyhd8ed1ab_0 conda-forge platformdirs 2.3.0 pyhd8ed1ab_0 conda-forge plotly 5.3.1 py_0 plotly pluggy 1.0.0 py38haa244fe_1 conda-forge pooch 1.5.2 pyhd8ed1ab_0 conda-forge poyo 0.5.0 py_0 conda-forge prometheus_client 0.11.0 pyhd8ed1ab_0 conda-forge promise 2.3 py38haa244fe_5 conda-forge prompt-toolkit 3.0.20 pyha770c72_0 conda-forge protobuf 3.19.1 py38h885f38d_1 conda-forge psutil 5.8.0 py38h294d835_1 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge py 1.10.0 pyhd3deb0d_0 conda-forge py-lz4framed 0.14.0 pypi_0 pypi pyasn1 0.4.8 py_0 conda-forge pyasn1-modules 0.2.8 py_0 pybind11-abi 4 hd8ed1ab_3 conda-forge pycodestyle 2.8.0 pyhd8ed1ab_0 conda-forge pycosat 0.6.3 py38h294d835_1009 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pydeprecate 0.3.1 pyhd8ed1ab_0 conda-forge pydocstyle 6.1.1 pyhd8ed1ab_0 conda-forge pyfftw 0.12.0 py38h46b76f8_3 conda-forge pyflakes 2.4.0 pyhd8ed1ab_0 conda-forge pygments 2.10.0 pyhd8ed1ab_0 conda-forge pyjwt 2.3.0 pyhd8ed1ab_0 conda-forge pylint 2.7.2 py38haa244fe_0 conda-forge pyls-spyder 0.4.0 pyhd8ed1ab_0 conda-forge pynacl 1.4.0 py38h31c79cd_2 conda-forge pyopenssl 21.0.0 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pypiwin32 223 pypi_0 pypi pyqt 5.12.3 py38haa244fe_7 conda-forge pyqt-impl 5.12.3 py38h885f38d_7 conda-forge pyqt5-sip 4.19.18 py38h885f38d_7 conda-forge pyqtchart 5.12 py38h885f38d_7 conda-forge pyqtwebengine 5.12.1 py38h885f38d_7 conda-forge pyrsistent 0.17.3 py38h294d835_2 conda-forge pysocks 1.7.1 py38haa244fe_3 conda-forge pysoundfile 0.10.3.post1 pyhd3deb0d_0 conda-forge pytest 6.2.5 py38haa244fe_0 conda-forge python 3.8.12 h7840368_1_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-lsp-black 1.0.0 pyhd8ed1ab_0 conda-forge python-lsp-jsonrpc 1.0.0 pyhd8ed1ab_0 conda-forge python-lsp-server 1.3.3 pyhd8ed1ab_0 conda-forge python_abi 3.8 2_cp38 conda-forge pytorch 1.10.0 py3.8_cuda11.3_cudnn8_0 pytorch pytorch-lightning 1.5.6 pyhd8ed1ab_0 conda-forge pytorch-mutex 1.0 cuda pytorch pytz 2021.3 pyhd8ed1ab_0 conda-forge pyu2f 0.1.5 pyhd8ed1ab_0 conda-forge pywin32 301 py38h294d835_0 conda-forge pywin32-ctypes 0.2.0 py38haa244fe_1003 conda-forge pywinpty 1.1.4 py38hd3f51b4_0 conda-forge pyyaml 5.4.1 py38h294d835_1 conda-forge pyzmq 22.3.0 py38h09162b1_0 conda-forge qdarkstyle 3.0.2 pyhd8ed1ab_0 conda-forge qstylizer 0.2.1 pyhd8ed1ab_0 conda-forge qt 5.12.9 h5909a2a_4 conda-forge qtawesome 1.0.3 pyhd8ed1ab_0 conda-forge qtconsole 5.2.2 pyhd8ed1ab_0 conda-forge qtpy 1.11.2 pyhd8ed1ab_0 conda-forge regex 2021.10.8 py38h294d835_0 conda-forge reproc 14.2.3 h8ffe710_0 conda-forge reproc-cpp 14.2.3 h0e60522_0 conda-forge requests 2.26.0 pyhd8ed1ab_0 conda-forge requests-oauthlib 1.3.0 pyh9f0ad1d_0 conda-forge requests-unixsocket 0.2.0 py_0 conda-forge resampy 0.2.2 py_0 conda-forge rope 0.20.1 pyhd8ed1ab_0 conda-forge rsa 4.7.2 pyh44b312d_0 conda-forge rtree 0.9.7 py38h8b54edf_2 conda-forge ruamel_yaml 0.15.100 py38h2bbff1b_0 scikit-learn 1.0 py38h8224a6f_1 conda-forge scipy 1.7.1 py38ha1292f7_0 conda-forge send2trash 1.8.0 pyhd8ed1ab_0 conda-forge sentry-sdk 1.5.0 pyhd8ed1ab_0 conda-forge setuptools 58.2.0 py38haa244fe_0 conda-forge shortuuid 1.0.8 py38haa244fe_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge smmap 3.0.5 pyh44b312d_0 conda-forge sniffio 1.2.0 py38haa244fe_1 conda-forge snowballstemmer 2.1.0 pyhd8ed1ab_0 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge sounddevice 0.4.3 pypi_0 pypi sphinx 4.2.0 pyh6c4a22f_0 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_0 conda-forge spyder 5.2.1 py38haa244fe_0 conda-forge spyder-kernels 2.2.0 py38haa244fe_0 conda-forge sqlite 3.36.0 h8ffe710_2 conda-forge subprocess32 3.5.4 py_1 conda-forge sympy 1.9 py38haa244fe_0 conda-forge tbb 2021.3.0 h2d74725_0 conda-forge tenacity 8.0.1 py38haa95532_0 tensorboard 2.6.0 pyhd8ed1ab_1 conda-forge tensorboard-data-server 0.6.0 py38haa244fe_1 conda-forge tensorboard-plugin-wit 1.8.0 pyh44b312d_0 conda-forge termcolor 1.1.0 py_2 conda-forge terminado 0.12.1 py38haa244fe_0 conda-forge testpath 0.5.0 pyhd8ed1ab_0 conda-forge textdistance 4.2.1 pyhd8ed1ab_0 conda-forge threadpoolctl 3.0.0 pyh8a188c0_0 conda-forge three-merge 0.1.1 pyh9f0ad1d_0 conda-forge tinycss2 1.1.0 pyhd8ed1ab_0 conda-forge tk 8.6.11 h8ffe710_1 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 1.2.1 pyhd8ed1ab_0 conda-forge torchinfo 1.5.4 pyhd8ed1ab_0 conda-forge torchmetrics 0.6.0 pyhd8ed1ab_0 conda-forge torchsummary 1.5.1 pypi_0 pypi torchvision 0.11.1 py38_cu113 pytorch tornado 6.1 py38h294d835_1 conda-forge tqdm 4.62.3 pyhd8ed1ab_0 conda-forge traitlets 4.3.3 pypi_0 pypi typed-ast 1.4.3 py38h294d835_0 conda-forge typing-extensions 3.10.0.2 hd8ed1ab_0 conda-forge typing_extensions 3.10.0.2 pyha770c72_0 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge ujson 4.2.0 py38h885f38d_0 conda-forge urllib3 1.26.7 pyhd8ed1ab_0 conda-forge vc 14.2 hb210afc_5 conda-forge vs2015_runtime 14.29.30037 h902a5da_5 conda-forge wandb 0.12.9 pyhd8ed1ab_0 conda-forge watchdog 2.1.6 py38haa244fe_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge websocket-client 0.58.0 py38haa95532_4 werkzeug 2.0.1 pyhd8ed1ab_0 conda-forge wheel 0.37.0 pyhd8ed1ab_1 conda-forge whichcraft 0.6.1 py_0 conda-forge widgetsnbextension 3.5.2 py38haa244fe_0 conda-forge win10toast 0.9 pypi_0 pypi win_inet_pton 1.1.0 py38haa244fe_2 conda-forge winpty 0.4.3 4 conda-forge wrapt 1.12.1 py38h294d835_3 conda-forge xz 5.2.5 h62dcd97_1 conda-forge yaml 0.2.5 he774522_0 conda-forge yaml-cpp 0.6.3 ha925a31_4 conda-forge yapf 0.31.0 pyhd8ed1ab_0 conda-forge yarl 1.7.2 py38h294d835_1 conda-forge yaspin 2.1.0 pyhd8ed1ab_0 conda-forge zeromq 4.3.4 h0e60522_1 conda-forge zipp 3.6.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h8ffe710_1013 conda-forge zstd 1.5.0 h6255e5f_0 conda-forge ```
conda info ``` active environment : pyt active env location : D:\Anaconda\envs\pyt shell level : 2 user config file : C:\Users\OverL\.condarc populated config files : C:\Users\OverL\.condarc conda version : 4.10.3 conda-build version : 3.18.11 python version : 3.8.3.final.0 virtual packages : __cuda=11.5=0 __win=0=0 __archspec=1=x86_64 base environment : D:\Anaconda (writable) conda av data dir : D:\Anaconda\etc\conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : D:\Anaconda\pkgs C:\Users\OverL\.conda\pkgs C:\Users\OverL\AppData\Local\conda\conda\pkgs envs directories : D:\Anaconda\envs C:\Users\OverL\.conda\envs C:\Users\OverL\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.10.3 requests/2.24.0 CPython/3.8.3 Windows/10 Windows/10.0.19041 administrator : False netrc file : C:\Users\OverL/.netrc offline mode : False ```

MRE from docs:

code ```python import os import torch from pytorch_lightning import LightningModule, Trainer from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader, random_split from torchmetrics import Accuracy from torchvision import transforms from torchvision.datasets import MNIST PATH_DATASETS = os.environ.get("PATH_DATASETS", ".") AVAIL_GPUS = min(1, torch.cuda.device_count()) BATCH_SIZE = 256 if AVAIL_GPUS else 64 class MNISTModel(LightningModule): def __init__(self): super().__init__() self.l1 = torch.nn.Linear(28 * 28, 10) def forward(self, x): return torch.relu(self.l1(x.view(x.size(0), -1))) def training_step(self, batch, batch_nb): x, y = batch loss = F.cross_entropy(self(x), y) return loss def configure_optimizers(self): return torch.optim.Adam(self.parameters(), lr=0.02) # Init our model mnist_model = MNISTModel() # Init DataLoader from MNIST Dataset train_ds = MNIST(PATH_DATASETS, train=True, download=True, transform=transforms.ToTensor()) train_loader = DataLoader(train_ds, batch_size=BATCH_SIZE) # Initialize a trainer trainer = Trainer( gpus=AVAIL_GPUS, max_epochs=3, progress_bar_refresh_rate=20, ) # Train the model ⚡ trainer.fit(mnist_model, train_loader) ```

cc @awaelchli @rohitgr7

OverLordGoldDragon commented 2 years ago

Uninstalling ipywidgets fixes the problem - but don't know why, and this shouldn't be needed.

awaelchli commented 2 years ago

We have this code here: https://github.com/PyTorchLightning/pytorch-lightning/blob/cf5ef32f7bc82b9fd76e1d8cc53b555b4422680c/pytorch_lightning/callbacks/progress/tqdm_progress.py#L23-L27

Which means when you uninstall the ipywidgets, you hit this import:

from tqdm import tqdm

and otherwise

from tqdm.auto import tqdm

So I suspect if you did

from tqdm.auto import tqdm
for j in tqdm(100, file=sys.stdout, leave=False, unit_scale=True, desc='loop'):
    time.sleep(1)

it would show the same behavior. Can you confirm?

awaelchli commented 2 years ago

Side note: in Lightning, the rich progress bar will soon replace the tqdm as default. #10912

OverLordGoldDragon commented 2 years ago

Can you confirm?

Confirmed, with a slight difference - it shows an empty progress bar (whereas PL doesn't show any):

loop:   0%|          | 0.00/100 [00:00<?, ?it/s]

rich progress bar

Can it be used now?

rohitgr7 commented 2 years ago

rich progress bar

Can it be used now?

yes: https://pytorch-lightning.readthedocs.io/en/latest/extensions/generated/pytorch_lightning.callbacks.RichProgressBar.html

awaelchli commented 2 years ago

These lines were added here https://github.com/PyTorchLightning/pytorch-lightning/pull/2417 to fix another issue with tqdm+ipywidgets. I suspect what you are seeing is another problem with tqdm/ipywidgets itself upstream, I am unsure. It's maybe worth reporting there too to get more insight.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!