Closed Philopatearashraf closed 4 years ago
I don't know why this happened but I found out that if you use windows this will be solved by setting num_workers to zero
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size, shuffle=True,collate_fn=train_dataset.collate_fn, num_workers=workers,pin_memory=True)
when I am trying to run either train.py or eval.py it gets me that error and I didn't find an answer for this issue. any HELP?
runfile('D:/my college books/SEMESTERS/8 SENIOR2/Spring20/a-PyTorch-Tutorial-to-Object-Detection-master/eval.py', wdir='D:/my college books/SEMESTERS/8 SENIOR2/Spring20/a-PyTorch-Tutorial-to-Object-Detection-master') Reloaded modules: utils, model Evaluating: 0%| | 0/78 [00:00<?, ?it/s]Traceback (most recent call last):
File "D:\my college books\SEMESTERS\8 SENIOR2\Spring20\a-PyTorch-Tutorial-to-Object-Detection-master\eval.py", line 88, in
evaluate(test_loader, model)
File "D:\my college books\SEMESTERS\8 SENIOR2\Spring20\a-PyTorch-Tutorial-to-Object-Detection-master\eval.py", line 54, in evaluate for i, (images, boxes, labels, difficulties) in enumerate(tqdm(test_loader, desc='Evaluating')):
File "D:\Programs\anaconda_trial2\lib\site-packages\tqdm\std.py", line 1107, in iter for obj in iterable:
File "D:\Programs\anaconda_trial2\lib\site-packages\torch\utils\data\dataloader.py", line 279, in iter return _MultiProcessingDataLoaderIter(self)
File "D:\Programs\anaconda_trial2\lib\site-packages\torch\utils\data\dataloader.py", line 719, in init w.start()
File "D:\Programs\anaconda_trial2\lib\multiprocessing\process.py", line 112, in start self._popen = self._Popen(self)
File "D:\Programs\anaconda_trial2\lib\multiprocessing\context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj)
File "D:\Programs\anaconda_trial2\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj)
File "D:\Programs\anaconda_trial2\lib\multiprocessing\popen_spawn_win32.py", line 89, in init reduction.dump(process_obj, to_child)
File "D:\Programs\anaconda_trial2\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj)
BrokenPipeError: [Errno 32] Broken pipe