提交 587f9021 编写于 作者: D dengkaipeng

fix int64 error on windows

上级 2b426605
......@@ -113,7 +113,7 @@ class KineticsDataset(Dataset):
if self.transform:
imgs, label = self.transform(imgs, label)
return imgs, np.array([label])
return imgs, np.array([label]).astype('int64')
@property
def num_classes(self):
......
......@@ -123,7 +123,7 @@ class Flowers(Dataset):
if self.transform is not None:
image, label = self.transform(image, label)
return image, label
return image, label.astype('int64')
def __len__(self):
return len(self.indexes)
......@@ -144,7 +144,7 @@ class MNIST(Dataset):
for i in range(buffer_size):
self.images.append(images[i, :])
self.labels.append(np.array([labels[i]]))
self.labels.append(np.array([labels[i]]).astype('int64'))
def __getitem__(self, idx):
image, label = self.images[idx], self.labels[idx]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册