这是因为DataLoader中开启了多线程,将num_workers 删除或者改为1即可。
gen = DataLoader(train_dataset, shuffle = shuffle, batch_size = batch_size, num_workers = num_workers)
这是因为DataLoader中开启了多线程,将num_workers 删除或者改为1即可。
gen = DataLoader(train_dataset, shuffle = shuffle, batch_size = batch_size, num_workers = num_workers)