batch_size = 2# 256 def get_dataloader_workers(): #@save """使用4个进程来读取数据。""" return 4 train_iter = data.DataLoader(mnist_train, batch_size, shuffle=True, num_workers=get_dataloader_workers()) timer = d2l.Timer() for X, y in train_iter: continue f'{timer.stop():.2f} sec'
【Python报错】RuntimeError: DataLoader worker (pid(s) 9764, 15128) exited unexpectedly
内容版权声明:除非注明,否则皆为本站原创文章。