dearleiii / PIRM-2018-SISR-Challenge

Super Resolution
https://www.pirm2018.org/PIRM-SR.html
2 stars 0 forks source link

RuntimeError: cuda runtime error (2) : out of memory at /pytorch/aten/src/THC/generic/THCStorage.cu:58 #10

Closed dearleiii closed 6 years ago

dearleiii commented 6 years ago

leichen@gpu-compute1$ python3 scatter_edsr.py THCudaCheck FAIL file=/pytorch/aten/src/THC/generic/THCStorage.cu line=58 error=2 : out of memory Traceback (most recent call last): File "scatter_edsr.py", line 45, in approximator.to(device) File "/home/home2/leichen/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 393, in to return self._apply(lambda t: t.to(device)) File "/home/home2/leichen/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 176, in _apply module._apply(fn) File "/home/home2/leichen/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 176, in _apply module._apply(fn) File "/home/home2/leichen/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 176, in _apply module._apply(fn) File "/home/home2/leichen/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 182, in _apply param.data = fn(param.data) File "/home/home2/leichen/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 393, in return self._apply(lambda t: t.to(device)) RuntimeError: cuda runtime error (2) : out of memory at /pytorch/aten/src/THC/generic/THCStorage.cu:58 leichen@gpu-compute1$ emacs scatter_edsr.py

dearleiii commented 6 years ago

Decrease model size, s.t convolutional layers,/ Ndf ect.

dearleiii commented 6 years ago

device = torch.device("cuda:0") gpu_list = list(range(0, torch.cuda.device_count()))

approximator = torch.nn.DataParallel(APXM_edsr(), device_ids=[0, 1, 2, 3, 4])

print("cuda.current_device=", torch.cuda.current_device())

approximator = APXM_edsr() approximator = torch.nn.DataParallel(approximator) approximator.to(device) print(approximator)