Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] GPU OOM when running BasicVSR model using MMagicInferencer #2145

Open
3 tasks done
kvnsng opened this issue Jun 13, 2024 · 0 comments
Open
3 tasks done

[Bug] GPU OOM when running BasicVSR model using MMagicInferencer #2145

kvnsng opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
kind/bug something isn't working

Comments

@kvnsng
Copy link

kvnsng commented Jun 13, 2024

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmagic

Environment

torch==2.1.2
pytorch-cuda=12.*
mmcv==2.1.0
mmengine==0.10.4
mmagic==1.2.0

Reproduces the problem - code sample

import os
from mmagic.apis import MMagicInferencer
from mmengine import mkdir_or_exist

video = "../data/video/barry-1.mp4"
result_out_dir = "./results/barry-1_basicvsrpp.mp4"
mkdir_or_exist(os.path.dirname(result_out_dir))
editor = MMagicInferencer('basicvsr')
results = editor.infer(video=video, result_out_dir=result_out_dir)

Reproduces the problem - command or script

run the python script above

Reproduces the problem - error message

OutOfMemoryError: CUDA out of memory. Tried to allocate 3.73 GiB. GPU 0 has a total capacty of 14.58 GiB of which 3.24 GiB is free. Including non-PyTorch memory, this process has 11.33 GiB memory in use. Of the allocated memory 11.22 GiB is allocated by PyTorch, and 3.35 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Additional information

I'm getting OOM error when I'm running the basicvsr model using the MMagicInferencer. Is there somewhere in the config or model where I can reduce the memory usage in order to run this using the MMagicInferencer?

@kvnsng kvnsng added the kind/bug something isn't working label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants