You can design your own ‘torch.utils.data.Dataset’, for example, load data based on .txt file in which each line include image_path, label and label_count, so you can load image,label and label_count simultaneously.