Solved by Leroy_Freyler in post #2 
              
              
                Hello, 
just found my mistake. 
The Dataloader works with the len function.I had connected it with the previous dataform. So my problem is solved. 
The code should look like the following. 
class SpectralDataset(Dataset):
    def __init__(self):
        xy = np.loadtxt(Dataset_Path, delimiter=",", d…