![]() > 1133 data = self._data_queue.get(timeout=timeout)įile c:\Users\user_name\AppData\Local\mambaforge\envs\pytorch_2.0\lib\multiprocessing\queues.py:114, in Queue.get(self, block, timeout) The full traceback is the same for both blocks: -įile c:\Users\user_name\AppData\Local\mambaforge\envs\pytorch_2.0\lib\site-packages\torch\utils\data\dataloader.py:1133, in _MultiProcessingDataLoaderIter._try_get_data(self, timeout) ![]() I'm primarily concerned with a Linux implementation, and perhaps this additional information doesn't really add to the question, but, for what's worth, on Windows 11 both the third and fourth (after commenting out the third) data-loading blocks fail with the following error message: RuntimeError: DataLoader worker (pid(s) 9364) exited unexpectedly RuntimeError Traceback (most recent call last)ĥ0 pin_dataloader = DataLoader(dataset, num_workers=1, batch_size=2, collate_fn=pin_collator, pin_memory=True)įile ~/miniforge3/envs/pytorch_2-0/lib/python3.10/site-packages/torch/utils/data/dataloader.py:634, in _BaseDataLoaderIter._next_(self)Ħ33 self._reset() # type: ignoreĦ36 if self._dataset_kind = _DatasetKind.Iterable and \Ħ37 self._IterableDataset_len_called is not None and \Ħ38 self._num_yielded > self._IterableDataset_len_called:įile ~/miniforge3/envs/pytorch_2-0/lib/python3.10/site-packages/torch/utils/data/dataloader.py:1346, in _MultiProcessingDataLoaderIter._next_data(self)įile ~/miniforge3/envs/pytorch_2-0/lib/python3.10/site-packages/torch/utils/data/dataloader.py:1372, in _MultiProcessingDataLoaderIter._process_data(self, data)ġ371 if isinstance(data, ExceptionWrapper):įile ~/miniforge3/envs/pytorch_2-0/lib/python3.10/site-packages/torch/_utils.py:644, in ExceptionWrapper.reraise(self)Ħ41 # If the exception takes multiple arguments, don't try toĦ42 # instantiate since we don't know how to RuntimeError: CUDA driver error: initialization error Original Traceback (most recent call last):įile "/home/user_name/miniforge3/envs/pytorch_2-0/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loopįile "/home/user_name/miniforge3/envs/pytorch_2-0/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetchįile "/tmp/ipykernel_822116/2862910865.py", line 17, in pin_collator However, in Ubuntu 22.04, either "native" or under WSL, and using pytorch 2.0 and cuda 11.8, I got the following error message pertaining to the fourth data-loading block ("Pinned, 1 worker"): RuntimeError: Caught RuntimeError in DataLoader worker process 0. Pin_dataloader = DataLoader(dataset, num_workers=1, batch_size=2, collate_fn=pin_collator, pin_memory=True) Pin_dataloader = DataLoader(dataset, num_workers=0, batch_size=2, collate_fn=pin_collator, pin_memory=True)ĭataloader = DataLoader(dataset, num_workers=1, batch_size=2, collate_fn=collator) Self.x = ĭataloader = DataLoader(dataset, num_workers=0, batch_size=2, collate_fn=collator) To test a few scenarios, I wrote the following code: import torch From, it seems that it should be possible (whether it is desirable is separate question) to have both pin_memory=True and num_workers=1 (or 2, 3, etc.) as arguments of a DataLoader, if some care is taken with the collator function passed as the named argument collate_fn to the DataLoader. I'm learning about methods to accelerate the training of deep-learning models using PyTorch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |