NeuralNeighborStyleTransfer icon indicating copy to clipboard operation
NeuralNeighborStyleTransfer copied to clipboard

RuntimeError: CUDA error: out of memory

Open minghong-X opened this issue 2 years ago • 4 comments

Why do I get this error using 3090 with 24GB of memory RuntimeError: CUDA error: out of memory Thank you for your answer!!!

minghong-X avatar Jun 05 '22 17:06 minghong-X

Hi Minghong-X, I'm sorry, but I don't know why you're running out of memory with that GPU, it should have plenty of memory for NNST. Are you running anything else at the same time on the GPU (driving a monitor etc?). I may be able to help more if you post the exact command you are running that is giving the error (but also might not be able to help). Best, Nick

nkolkin13 avatar Jun 05 '22 18:06 nkolkin13

Thank you for your reply! I'm not running any other programs on this GPU.Just the "NeuralNeighborStyleTransfer-main" program.I tried some ways to solve it, but all failed.

The run command I use is:"python styleTransfer.py --content_path PATH_TO_CONTENT_IMAGE --style_path PATH_TO_STYLE_IMAGE --output_path PATH_TO_OUTPUT."

And all the error messages are as follows:

File "styleTransfer.py", line 55, in cnn = misc.to_device(Vgg16Pretrained()) File "/hy-tmp/utils/misc.py", line 17, in to_device return tensor.cuda() File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 680, in cuda return self._apply(lambda t: t.cuda(device)) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 570, in _apply module._apply(fn) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 570, in _apply module._apply(fn) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 593, in _apply param_applied = fn(param) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 680, in return self._apply(lambda t: t.cuda(device)) RuntimeError: CUDA error: out of memory CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

minghong-X avatar Jun 05 '22 18:06 minghong-X

I assume you are replacing the PATH_TO_X arguments with actual file paths?

nkolkin13 avatar Jun 05 '22 18:06 nkolkin13

I tried to do this with a CPU Thank you! I can't seem to figure it out!

minghong-X avatar Jun 06 '22 14:06 minghong-X