sdc17 / UPop

[ICML 2023] UPop: Unified and Progressive Pruning for Compressing Vision-Language Transformers.

Home Page:https://dachuanshi.com/UPop-Project/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

显存被占满

Zaragoto opened this issue · comments

commented

您好,我在试运行您的代码的时候,显示我的显存被占满。报错信息如下:

RuntimeError: CUDA out of memory. Tried to allocate 290.00 MiB (GPU 0; 31.75 GiB total capacity; 29.78 GiB already allocated; 113.50 MiB free; 30.27 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

我检索到占满内存的代码是 loss = model(image, caption, alpha=alpha, idx=idx)

想问一下该怎么解决内存占满的问题呢?谢谢!

您好,如果有多卡,可以尝试使用python -m torch.distributed.run进行多卡训练。如果使用单卡,可以将超参数batch size的数值调小。

Hi, if you have multiple GPUs, please launch scripts with python -m torch.distributed.run for distributed training. If you are using a single GPU, please try a smaller value for batch size.