Dataloader stucks?

username: Cverlpeng
cooked: <p>hi,<br>
thanks!!!<br>
I try train a model of segmentation ,when epoch = 13 Dataloader stucks （The cursor flashes normally and will not throw an error and will not continue.）,The program will stop at this line ‘’ for i, (image, target) in enumerate(tbar):‘’ , when epoch &lt; 13 ,such as epoch=11, Can run normally。</p>
<pre data-code-wrap="python"><code class="lang-python">self.trainloader = data.DataLoader(trainset, batch_size=args.batch_size,
                                           drop_last=True, shuffle=True, **kwargs)
self.valloader = data.DataLoader(testset, batch_size=args.batch_size,
                                         drop_last=False, shuffle=False, **kwargs)

def training(self, epoch, writer):
        train_loss = 0.0
        self.model.train()
        tbar = tqdm(self.trainloader)
        start_iter = epoch * tbar.total

        for i, (image, target) in enumerate(tbar):
            self.scheduler(self.optimizer, i, epoch, self.best_pred)
            self.optimizer.zero_grad()
           .....................



</code></pre>
<p>epoch  = 11<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/1/1e7c2f161331a37e48df13c7d3c8a94546a6156b.png" data-download-href="https://discuss.pytorch.org/uploads/default/1e7c2f161331a37e48df13c7d3c8a94546a6156b" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/1/1e7c2f161331a37e48df13c7d3c8a94546a6156b_2_690x53.png" alt="image" data-base62-sha1="4lGnZsQN8nZgk8uHcLdsbDGEIiv" width="690" height="53" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/1/1e7c2f161331a37e48df13c7d3c8a94546a6156b_2_690x53.png, https://discuss.pytorch.org/uploads/default/optimized/2X/1/1e7c2f161331a37e48df13c7d3c8a94546a6156b_2_1035x79.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/2X/1/1e7c2f161331a37e48df13c7d3c8a94546a6156b_2_1380x106.png 2x" data-dominant-color="735A6B"><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">1845×144 24.8 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><br>
epoch = 13<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/4/49e6d4802435ae36b5defd75111c11d88f896f3d.png" data-download-href="https://discuss.pytorch.org/uploads/default/49e6d4802435ae36b5defd75111c11d88f896f3d" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/4/49e6d4802435ae36b5defd75111c11d88f896f3d_2_690x87.png" alt="image" data-base62-sha1="axLpcCsIv4ieC47zrQvZnIUrdM1" width="690" height="87" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/4/49e6d4802435ae36b5defd75111c11d88f896f3d_2_690x87.png, https://discuss.pytorch.org/uploads/default/optimized/2X/4/49e6d4802435ae36b5defd75111c11d88f896f3d_2_1035x130.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/2X/4/49e6d4802435ae36b5defd75111c11d88f896f3d_2_1380x174.png 2x" data-dominant-color="5D3F53"><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">1846×235 42.6 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>nvidia-smi show<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/d/d45627d2d4a6383185bed6b51a80c202cd22223b.png" data-download-href="https://discuss.pytorch.org/uploads/default/d45627d2d4a6383185bed6b51a80c202cd22223b" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/2X/d/d45627d2d4a6383185bed6b51a80c202cd22223b.png" alt="image" data-base62-sha1="uipOi9ct2IEngJXInR03OKhxBP5" width="690" height="192" data-dominant-color="432038"><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">788×220 30.9 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>

username: Cverlpeng
cooked: <p>Although no one reply me,I set print() get error of stucks?<br>
program stop on getitem()  cv2.resize() function,I use PIL read mask,The program continues to run down，but I don`t know why?<br>
my dataset class</p>
<pre><code class="lang-python">def __getitem__(self, index):
      .......................
     ow, oh = 800, 288
     mask = cv2.imread(self.masks[index], cv2.IMREAD_GRAYSCALE)
     mask = cv2.resize(mask, (ow, oh), cv2.INTER_NEAREST)
     ..................
</code></pre>

username: rexlow
cooked: <p>Some of the things you can do:</p>
<ul>
<li>Verify if the image you are trying to load is valid</li>
<li>Monitor your physical RAM size</li>
</ul>