Skip to content

Memory leak in the windows build (development version) #5590

@shekhovt

Description

@shekhovt

Related to windows support issue #494

  • OS: Windows 10/ x64
  • PyTorch version: pytorch-0.3.1. from repo https://github.com/peterjc123/pytorch-scripts
  • How you installed PyTorch (conda, pip, source): conda
  • Python version: 3.6.1 (64-bit)
  • CUDA/cuDNN version: CUDA 8.0.60, cuDNN: 6.0.21, driver version: 382.05
  • GPU models and configuration: GTX1080

During training, each epoch eats up memory until the virtual memory is over (pagefile size). Then it throws the error:

Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
MemoryError

... my stuff...

File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 417, in iter
return DataLoaderIter(self)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 234, in init
w.start()
File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
BrokenPipeError: [Errno 32] Broken pipe

The error is raised from the the data loader, but I am not sure it is the one to blame, maybe it just happens to be the one needing memory when there is none available.
I am using num_workers=1, as recommended above in this forum.

peteterjc123 commented that a workaround is to set num_workers=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions