below is my code.
from __future__ import print_function
import torch.utils.data as data
import os
import os.path
import errno
import torch
import json
import h5py

from IPython.core.debugger import Tracer 
debug_here = Tracer() 

import numpy as np
import sys

import json


class Modelnet40_V12_Dataset(data.Dataset):
    def __init__(self, data_dir, image_size = 224, train=True):
        self.image_size = image_size
        self.data_dir = data_dir
        self.train = train 

        file_path = os.path.join(self.data_dir, 'modelnet40.h5')
        self.modelnet40_data = h5py.File(file_path)
        
        if self.train: 
            self.train_data = self.modelnet40_data['train']['data']
            self.train_labels = self.modelnet40_data['train']['label']
        else:
            self.test_data = self.modelnet40_data['test']['data']
            self.test_labels = self.modelnet40_data['test']['label']

    def __getitem__(self, index):
        if self.train:
            shape_12v, label = self.train_data[index], self.train_labels[index] 
        else:
            shape_12v, label = self.test_data[index], self.test_labels[index]
        return shape_12v, label 


    def __len__(self):
        if self.train:
            return self.train_data.shape[0]
        else:
            return self.test_data.shape[0]

if __name__ == '__main__':
    print('test')
    train_dataset = Modelnet40_V12_Dataset(data_dir='path/data', train=True)
    print(len(train_dataset))

    test_dataset = Modelnet40_V12_Dataset(data_dir='path/data', train=False)
    print(len(test_dataset))
    train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=8,
                                     shuffle=True, num_workers=2)


    total = 0 
    # debug_here() 
    # check when to cause labels error 
    for epoch in range(200):
        print('epoch', epoch)
        for i, (input_v, labels) in enumerate(train_loader):
            total = total + labels.size(0)

            # labels can be 255, what is the problem??
            if labels.max() > 40: 
                debug_here() 
                print('error')

            if labels.min() < 1:
                debug_here()  
                print('error')
            
            labels.sub_(1) # minus 1 in place 
            
            if labels.max() >= 40: 
                debug_here() 
                print('error')

            if labels.min() < 0:
                debug_here()  
                print('error')
        print(total)


can someone give some help ??