Solved by Nikronic in post #2 
              
              
                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. 

The issue is nn.Linear …