From 83f1d6652cdd5d8f5dba9f83790837a0dd3946d9 Mon Sep 17 00:00:00 2001 From: Vinh Quang Tran Date: Wed, 12 Oct 2022 08:41:15 +0700 Subject: [PATCH] Fix `TypeError` when loading dataset --- recognition/arcface_torch/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recognition/arcface_torch/dataset.py b/recognition/arcface_torch/dataset.py index f1b51797f..98079ea72 100644 --- a/recognition/arcface_torch/dataset.py +++ b/recognition/arcface_torch/dataset.py @@ -162,7 +162,7 @@ def __getitem__(self, index): label = header.label if not isinstance(label, numbers.Number): label = label[0] - label = torch.tensor(label, dtype=torch.long) + label = torch.tensor(label.astype(int), dtype=torch.long) sample = mx.image.imdecode(img).asnumpy() if self.transform is not None: sample = self.transform(sample)