Solved by Abdul in post #3 
              
              
                This solved my problem. 
def __next__(self):
        if(self._counter < len(self.index)):
            self.sample = self._data[self.index[self._counter] : self.index[self._counter] + self._chunk_size, :]
            self.label = self._labels[self.index[self._counter]]
            
            if sel…