Yolo-FastestV2 icon indicating copy to clipboard operation
Yolo-FastestV2 copied to clipboard

RuntimeError

Open jasonp0927 opened this issue 3 years ago • 3 comments

训练时候,提示这个错误。 RuntimeError: Pin memory thread exited unexpectedly

jasonp0927 avatar Nov 27 '21 09:11 jasonp0927

请问解决了吗?

Codekang avatar Dec 22 '21 09:12 Codekang

I got the same error

Initialize weights: model/backbone/backbone.pth Starting training for 10 epochs... Epoch:0 LR:0.000002 CIou:3.969100 Obj:62.182312 Cls:23.107639 Total:89.259048: 100%|██████████| 117/117 [00:16<00:00, 6.95it/s] 0%| | 0/117 [00:00<?, ?it/s]Exception in thread Thread-2: Traceback (most recent call last): File "C:\Users\ashwi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner self.run() File "C:\Users\ashwi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "C:\Users\ashwi\PycharmProjects\NeuralRenderer\venv\lib\site-packages\torch\utils\data_utils\pin_memory.py", line 28, in _pin_memory_loop idx, data = r ValueError: not enough values to unpack (expected 2, got 0)

0%| | 0/117 [00:05<?, ?it/s] Traceback (most recent call last): File "C:/Users/ashwi/PycharmProjects/Yolo-FastestV2/train.py", line 99, in for imgs, targets in pbar: File "C:\Users\ashwi\PycharmProjects\NeuralRenderer\venv\lib\site-packages\tqdm\std.py", line 1158, in iter for obj in iterable: File "C:\Users\ashwi\PycharmProjects\NeuralRenderer\venv\lib\site-packages\torch\utils\data\dataloader.py", line 349, in iter self._iterator._reset(self) File "C:\Users\ashwi\PycharmProjects\NeuralRenderer\venv\lib\site-packages\torch\utils\data\dataloader.py", line 852, in _reset data = self._get_data() File "C:\Users\ashwi\PycharmProjects\NeuralRenderer\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1029, in _get_data raise RuntimeError('Pin memory thread exited unexpectedly') RuntimeError: Pin memory thread exited unexpectedly

Process finished with exit code 1

AshwinRaikar88 avatar Mar 04 '22 05:03 AshwinRaikar88

明白了,我使用的是 Pytorch 1.7.1,所以他们在数据加载器中有问题 将 Pytorch 更新到最新版本以解决该问题

Got it, I was using Pytorch 1.7.1 so they have an issue with the dataloader Update Pytorch to the latest version to get rid of the issue

AshwinRaikar88 avatar Mar 04 '22 05:03 AshwinRaikar88