Why does my train build show multiple lines in the output?

username: Jordan_Howell
cooked: <p>I’m building a training data set.  While it’s running it shows this:</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/1/8134566d3914834ea5e345a2fd86ba108e907462.png" data-download-href="https://discuss.pytorch.org/uploads/default/8134566d3914834ea5e345a2fd86ba108e907462" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/8/1/8134566d3914834ea5e345a2fd86ba108e907462.png" alt="image" data-base62-sha1="iqZJ2CkCVbBmONjouKlNnQ52CfE" width="586" height="500" data-dominant-color="FEDDDD"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">725×618 5.01 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>What not hold it to one line and show the progress as it goes?  Did I code something wrong?  Below is my training class:</p>
<blockquote>
<p>class roof_dataset():<br>
claims = ‘D:\CIS inspection images 0318\train\roof\claims’<br>
no_claims = ‘D:\CIS inspection images 0318\train\roof\no_claims’<br>
LABELS  = {claims: 1, no_claims: 0}<br>
training_data = <span class="chcklst-box fa fa-square-o fa-fw"></span></p>
<pre><code>claim_count = 0
no_claim_count = 0


def make_training_data(self):
    for label in self.LABELS:
        print(label)
        for f in tqdm(os.listdir(label)):
            if "JPG" in f:
                try:
                    path = os.path.join(label, f)
                    img = Image.open(path)
                    pic = train_transform(img)
                    self.training_data.append([pic, np.eye(2)[self.LABELS[label]]])
                    
                    if label == self.claims:
                        self.claim_count += 1
                    elif label == self.no_claims:
                        self.no_claim_count += 1

                except Exception as e:
                    pass
                    #print(label, f, str(e))
                    
    np.random.shuffle(self.training_data)
    np.save("D:\\CIS inspection images 0318\\self_build\\training_data.npy", self.training_data)
    print('claims:',self.claim_count)
    print('no_claims:',self.no_claim_count)
</code></pre>
</blockquote>

username: JuanFMontesinos
cooked: <p>that’s about tqdm not pytorch and iot’s probably because you are printing label</p>

username: Jordan_Howell
cooked: <p>I took the print(label) out and it still is doing it.  if it’s a tqdm issue, I’ll close it out here.  Thanks for pointing that out.</p>

username: JuanFMontesinos
cooked: <p>I also use and sometime i find that issue but couldn’t figure out why.</p>

username: Jordan_Howell
cooked: <p>Instead of</p>
<blockquote>
<p>from tqmd import tqmd</p>
</blockquote>
<p>, I put:</p>
<blockquote>
<p>from tqdm import tqdm_notebook as tqdm<br>
now it works!</p>
</blockquote>

username: JuanFMontesinos
cooked: <p>what’s the difference between both?</p>

username: Jordan_Howell
cooked: <p>I have no idea.  I didn’t have time to look into it.</p>

username: ptrblck
cooked: <p><code>tqdm_notebook</code> was written for Jupyter notebooks, if I’m not mistaken, since the vanilla <code>tqdm</code> might have some kind of weird behavior (like the one mentioned in the thread).</p>