OOTDiffusion icon indicating copy to clipboard operation
OOTDiffusion copied to clipboard

win10下,torch.cuda.OutOfMemoryError: CUDA out of memory.

Open Bruceywj opened this issue 1 year ago • 4 comments

运行命令: python run_ootd.py --model_path D:/OOTDiffusion/run/examples/model/model_2.png --cloth_path D:/OOTDiffusion/run/examples/garment/00055_00.jpg --scale 2.0 --sample 4

在最后报: torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 3.75 GiB. GPU 0 has a total capacty of 23.99 GiB of which 1.12 GiB is free. Of the allocated memory 20.95 GiB is allocated by PyTorch, and 117.26 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

请问这个需要怎么调整?

Bruceywj avatar Feb 29 '24 01:02 Bruceywj

https://github.com/levihsu/OOTDiffusion/issues/59#issuecomment-1965683568 可以试一下这个方法 os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "max_split_size_mb:128"

levihsu avatar Feb 29 '24 01:02 levihsu

01 加上后,跑到最后还是报了这个

Bruceywj avatar Feb 29 '24 01:02 Bruceywj

一样的报错,无法使用,作者看到的话希望能帮助下

WashingtonRB avatar Mar 28 '24 08:03 WashingtonRB

把你的 --sample 4 换成 --sample 1 即可

baimingl avatar Apr 16 '24 03:04 baimingl