Solved by ptrblck in post #2 
              
              
                Check the creation of the Dataset, sampler, and DataLoader as it seems as if the DataLoader got a None input as the dataset or sampler.