Hi thanks for answer. Before I used pytorch, I used the keras is ok for my code.
I used opencv to read and resize these data(same data) ink keras is ok for me.
 for filepath in train_batch:
#                         print('filepath:', filepath)
                        img = cv2.imread(filepath)
                        img = cv2.resize(img, img_size)
                        img = augment(img, np.random.randint(6))
                        x_batch.append(img)
                    x_batch = np.array(x_batch, np.float32) / 255.
                    y_batch = y_train[start:end]

I don’t know how to solve the issue in pytorch. I am a new one to pytorch