diff --git a/ppcls/data/dataloader/icartoon_dataset.py b/ppcls/data/dataloader/icartoon_dataset.py index 212341481b8bb10c98578cfb701f6a3c5a9709cd..18e3b4b7f1fac551e925de911bfd07e1e14584a4 100644 --- a/ppcls/data/dataloader/icartoon_dataset.py +++ b/ppcls/data/dataloader/icartoon_dataset.py @@ -32,5 +32,5 @@ class ICartoonDataset(CommonDataset): for l in lines: l = l.strip().split("\t") self.images.append(os.path.join(self._img_root, l[0])) - self.labels.append(int(l[1])) + self.labels.append(np.int64(l[1])) assert os.path.exists(self.images[-1]) diff --git a/ppcls/data/dataloader/imagenet_dataset.py b/ppcls/data/dataloader/imagenet_dataset.py index e084bb7419417a70d437c3b163c3d58b4648ca01..1166ab3851b0c594469f135c1c4b3c7bc921ac5f 100644 --- a/ppcls/data/dataloader/imagenet_dataset.py +++ b/ppcls/data/dataloader/imagenet_dataset.py @@ -34,5 +34,5 @@ class ImageNetDataset(CommonDataset): for l in lines: l = l.strip().split(" ") self.images.append(os.path.join(self._img_root, l[0])) - self.labels.append(int(l[1])) + self.labels.append(np.int64(l[1])) assert os.path.exists(self.images[-1]) diff --git a/ppcls/data/dataloader/logo_dataset.py b/ppcls/data/dataloader/logo_dataset.py index 3e05e7fedc1e5c01668beeaee5b8a25924fe4f55..132ead989ed07af7c1bed1288fd32eb44f4d0d86 100644 --- a/ppcls/data/dataloader/logo_dataset.py +++ b/ppcls/data/dataloader/logo_dataset.py @@ -28,6 +28,7 @@ import random from .common_dataset import CommonDataset + class LogoDataset(CommonDataset): def _load_anno(self): assert os.path.exists(self._cls_path) @@ -41,7 +42,5 @@ class LogoDataset(CommonDataset): if l[0] == 'image_id': continue self.images.append(os.path.join(self._img_root, l[3])) - self.labels.append(int(l[1])-1) + self.labels.append(np.int64(l[1]) - 1) assert os.path.exists(self.images[-1]) - - diff --git a/ppcls/data/dataloader/multilabel_dataset.py b/ppcls/data/dataloader/multilabel_dataset.py index 08d2ba15b02b2bd261ad210767b4feb0843fb67d..2c1ed770388035d2a9fa5a670948d9e1623a0406 100644 --- a/ppcls/data/dataloader/multilabel_dataset.py +++ b/ppcls/data/dataloader/multilabel_dataset.py @@ -37,7 +37,7 @@ class MultiLabelDataset(CommonDataset): self.images.append(os.path.join(self._img_root, l[0])) labels = l[1].split(',') - labels = [int(i) for i in labels] + labels = [np.int64(i) for i in labels] self.labels.append(labels) assert os.path.exists(self.images[-1]) diff --git a/ppcls/data/dataloader/vehicle_dataset.py b/ppcls/data/dataloader/vehicle_dataset.py index 80fc6bb08d6e2458ca2604dc91933b4a28971d2f..2981a57a0516aa25145f39479a34635b3be063f8 100644 --- a/ppcls/data/dataloader/vehicle_dataset.py +++ b/ppcls/data/dataloader/vehicle_dataset.py @@ -112,8 +112,8 @@ class VeriWild(Dataset): for l in lines: l = l.strip().split() self.images.append(os.path.join(self._img_root, l[0])) - self.labels.append(int(l[1])) - self.cameras.append(int(l[2])) + self.labels.append(np.int64(l[1])) + self.cameras.append(np.int64(l[2])) assert os.path.exists(self.images[-1]) def __getitem__(self, idx):