Unable to write to file </torch_18692_1954506624>

(Keith Yin) #1

Ubuntu : 16.04 server

Error : RuntimeError: unable to write to file </torch_18693_1954506624> at /pytorch/torch/lib/TH/THAllocator.c:271

I have encounted this error When run pytorch code in ubuntu server.

when debuging the code, i found the error occured at DataLoader.

The dataset’s __getitem__ method returned (img, label), the img’s type is ndarray. and i also tried returning img Tensor but in that condition, the process is blocked.

The code run properly at local, but failed at server.

What should i do to fix that?



Are you using Docker?
I had a similar issue and had to add the --ipc=host flag.

Please note that PyTorch uses shared memory to share data between processes, so if torch multiprocessing is used (e.g. for multithreaded data loaders) the default shared memory segment size that container runs with is not enough, and you should increase shared memory size either with --ipc=host or --shm-size command line options to nvidia-docker run.