Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_anom_dataset raised RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly' #113

Open
jerronl opened this issue Aug 2, 2023 · 1 comment

Comments

@jerronl
Copy link

jerronl commented Aug 2, 2023

When I ran the tutorial6\Transformers_and_MHAttention.ipynb, I got following error under the cell "To understand the dataset a little better, we can plot below a few sets from the test dataset. " in Set Anomaly Detection


RuntimeError                              Traceback (most recent call last)
Cell In[56], line 16
     13     plt.show()
     14     plt.close()
---> 16 _, indices, _ = next(iter(test_anom_loader))
     17 visualize_exmp(indices[:4], test_set)

File [d:\program\anaconda3\envs\dl2022\lib\site-packages\torch\utils\data\dataloader.py:628](file:///D:/program/anaconda3/envs/dl2022/lib/site-packages/torch/utils/data/dataloader.py:628), in _BaseDataLoaderIter.__next__(self)
    625 if self._sampler_iter is None:
    626     # TODO(https://github.com/pytorch/pytorch/issues/76750)
    627     self._reset()  # type: ignore[call-arg]
--> 628 data = self._next_data()
    629 self._num_yielded += 1
    630 if self._dataset_kind == _DatasetKind.Iterable and \
    631         self._IterableDataset_len_called is not None and \
    632         self._num_yielded > self._IterableDataset_len_called:

File [d:\program\anaconda3\envs\dl2022\lib\site-packages\torch\utils\data\dataloader.py:1316](file:///D:/program/anaconda3/envs/dl2022/lib/site-packages/torch/utils/data/dataloader.py:1316), in _MultiProcessingDataLoaderIter._next_data(self)
   1313     return self._process_data(data)
   1315 assert not self._shutdown and self._tasks_outstanding > 0
-> 1316 idx, data = self._get_data()
   1317 self._tasks_outstanding -= 1
   1318 if self._dataset_kind == _DatasetKind.Iterable:
   1319     # Check for _IterableDatasetStopIteration

File [d:\program\anaconda3\envs\dl2022\lib\site-packages\torch\utils\data\dataloader.py:1282](file:///D:/program/anaconda3/envs/dl2022/lib/site-packages/torch/utils/data/dataloader.py:1282), in _MultiProcessingDataLoaderIter._get_data(self)
   1278     # In this case, `self._data_queue` is a `queue.Queue`,. But we don't
   1279     # need to call `.task_done()` because we don't use `.join()`.
   1280 else:
   1281     while True:
-> 1282         success, data = self._try_get_data()
   1283         if success:
   1284             return data

File [d:\program\anaconda3\envs\dl2022\lib\site-packages\torch\utils\data\dataloader.py:1133](file:///D:/program/anaconda3/envs/dl2022/lib/site-packages/torch/utils/data/dataloader.py:1133), in _MultiProcessingDataLoaderIter._try_get_data(self, timeout)
   1131 if len(failed_workers) > 0:
   1132     pids_str = ', '.join(str(w.pid) for w in failed_workers)
-> 1133     raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e
   1134 if isinstance(e, queue.Empty):
   1135     return (False, None)

RuntimeError: DataLoader worker (pid(s) 50144, 61816, 57740, 42128) exited unexpectedly
@phlippe
Copy link
Owner

phlippe commented Oct 8, 2023

Hi, sorry for getting back so late on it. DataLoaders quitting unexpectedly can happen in Colab or a notebook when you interrupted a cell during data loading. Did you try to reload the data loaders and execute the cell again? This usually fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants