Dataloader stucks?

hi,
thanks!!!
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 < 13 ,such as epoch=11, Can run normally。

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()
           .....................



epoch = 11


epoch = 13

nvidia-smi show

Although no one reply me,I set print() get error of stucks?
program stop on getitem() cv2.resize() function,I use PIL read mask,The program continues to run down,but I don`t know why?
my dataset class

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)
     ..................

Some of the things you can do:

  • Verify if the image you are trying to load is valid
  • Monitor your physical RAM size