当前位置: 代码迷 >> 综合 >> (fast-reid)torch error:DataLoader worker (pid(s) 26462) exited unexpectedly
  详细解决方案

(fast-reid)torch error:DataLoader worker (pid(s) 26462) exited unexpectedly

热度:83   发布时间:2023-10-26 00:37:18.0

1.问题

之前的时候已经配置好了fast-reid的环境,隔了以后再次运行这个,发现出现缓存不足的问题:

File "/usr/local/lib/python3.6/dist-packages/torch/multiprocessing/reductions.py", line 315, in reduce_storagefd, size = storage._share_fd_()
RuntimeError: unable to write to file </torch_27458_75757216>0%|                                                                                                                                         | 0/76 [00:27<?, ?it/s]
Traceback (most recent call last):
RuntimeError: DataLoader worker (pid 26462) is killed by signal: Bus error.

2.分析

设置更低的num_work。发现还是出问题。

由于pytorch会写东西保存到缓存,但是磁盘不足的问题。

github issue上给出了解决方案https://github.com/huaweicloud/dls-example/issues/26#issuecomment-411990039:

将下面代码放到要运行的py文件import导

  相关解决方案