# Tqdm bar is not changing

**URL:** <https://discuss.pytorch.org/t/tqdm-bar-is-not-changing/124807>\
**Category:** Uncategorized\
**Created:** [June 23, 2021, 7:04am UTC](https://discuss.pytorch.org/t/tqdm-bar-is-not-changing/124807 "2021-06-23T07:04:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YoonhoRoh](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/y/53a042/32.png) [@YoonhoRoh](https://discuss.pytorch.org/u/YoonhoRoh)\
**Post date:** [June 23, 2021, 7:04am UTC](https://discuss.pytorch.org/t/tqdm-bar-is-not-changing/124807/1 "2021-06-23T07:04:11Z")

</div>

Hello, I’m trying to create progress bar using tqdm package.  
Here is my code

```auto
import numpy as np
import os
from glob import glob
from PIL import Image
from tqdm.notebook import tqdm

path = glob('dataset/mnist_png/training/*/*.png')

height = []
width = []

for i in tqdm(path):
    img_pil = Image.open(path)
    image = np.array(img_pil)
    h, w = image.shape
    height.append(h)
    width.append(w)

```

However, progress bar does not changing and stops like this, even though the calculation is done  
0%| | 0/60000 [00:00\<?, ?it/s]

Is there any way to make progress bar changing?  
I am looking forward to see any help. Thanks in advance.  
Kind regards,  
Yoon Ho

---

<div class="post-metadata">

**Author:** ![pascal\_notsawo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/pascal_notsawo/32/22829_2.png) [@pascal\_notsawo](https://discuss.pytorch.org/u/pascal_notsawo)\
**Post date:** [June 23, 2021, 8:03am UTC](https://discuss.pytorch.org/t/tqdm-bar-is-not-changing/124807/2 "2021-06-23T08:03:03Z")

</div>

Already, your code seems to have a problem : you still use path in the loop

```auto

for p in tqdm(path):

    #img_pil = Image.open(path) 

    img_pil = Image.open(p) 

    # ...

```

The code works for me without any problem.

```auto

import numpy as np

import os

from glob import glob

from PIL import Image

#from tqdm import tqdm

from tqdm.notebook import tqdm

path = glob('/content/*.png')

height = []

width = []

print("")

for p in tqdm(path):

    img_pil = Image.open(p)

    image = np.array(img_pil)

    print(image.shape)

    h, w, _ = image.shape

    height.append(h)

    width.append(w)

```

![1](https://discuss.pytorch.org/uploads/default/original/3X/d/0/d07b76568cc0a85a102993db21389fa07ff90fb9.jpeg)

---

<div class="post-metadata">

**Author:** ![YoonhoRoh](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/y/53a042/32.png) [@YoonhoRoh](https://discuss.pytorch.org/u/YoonhoRoh)\
**Post date:** [June 23, 2021, 9:53am UTC](https://discuss.pytorch.org/t/tqdm-bar-is-not-changing/124807/3 "2021-06-23T09:53:53Z")

</div>

Thanks for your answer.  
However, even though I replaced path to p, my bar still stops at  
0%| | 0/60000 [00:00\<?, ?it/s]
