zhengyuf / IMavatar

Official repository for CVPR 2022 paper: I M Avatar: Implicit Morphable Head Avatars from Videos
MIT License
628 stars 61 forks source link

CUDA out of memory #24

Closed carlosedubarreto closed 1 year ago

carlosedubarreto commented 1 year ago

Hello, I'm having this problem of cuda out of memory. My GPU has 6gb of ram, is there some configuration that I coudl do to make it run? Thanks

The error: RuntimeError: CUDA out of memory. Tried to allocate 66.00 MiB (GPU 0; 6.00 GiB total capacity; 4.25 GiB already allocated; 0 bytes free; 4.32 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

zhengyuf commented 1 year ago

you'll have to reduce the number of pixels here: https://github.com/zhengyuf/IMavatar/blob/fa33cc90f31113416b071cf014d44091554a80d3/code/confs/IMavatar_supervised.conf#L11

I have not tried a smaller number of pixels though, so no sure whether training can work.

carlosedubarreto commented 1 year ago

thank you for the fast answer, but changing that gave me the same error.

My best solution was to decrease the img_res to 64.

dataset{
    data_folder = ../data/datasets
    subject_name = yufeng
    json_name = flame_params.json
    train{
        sub_dir = [MVI_1810, MVI_1814] # in main paper, we used [MVI_1810, MVI_1811]
        # img_res = [256, 256]
        img_res = [64, 64]
        subsample = 1
    }
    test{
        sub_dir = [MVI_1812]
        # img_res = [256, 256]
        img_res = [64, 64]
        subsample=  200
    }

These were the changes I made. and now it is creating the ply. This is such an amazing work that you've done... simply amazing.