Hi,
I think the issue is that you are loading your data using numpy and by default numpy uses float64 data type which is double in PyTorch. I think if you add
name = name.astype(np.float32)
label = label.astype(np.float32)

Before returning an item, would solve the issue.



 neuralpat:

def __getitem__(self, index):
        name = self.names[index]
        label = self.labels[index]  
        # add those lines here
        return name, label



The issue is nn.Linear or other nn modules use float (or float32 in numpy) for parameters so there is mismatch between your loaded data and initialized weights.
Another point is that I can see you are not using any particular function from numpy, so you can write your entire data loading flow using PyTorch itself.
Bests