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导