bubbliiiing / segformer-pytorch

这是一个segformer-pytorch的源码,可以用于训练自己的模型。
MIT License
271 stars 35 forks source link

跑到50轮,会爆显存有什么解决办法吗 #33

Open yxddzho opened 5 months ago

yxddzho commented 5 months ago

CUDA out of memory. Tried to allocate 320.00 MiB. GPU 0 has a total capacity of 8.00 GiB of which 0 bytes is free. Of the allocated memory 6.84 GiB is allocated by PyTorch, and 157.12 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)

Jalnf013516 commented 5 months ago

如果你没关Freeze_Train,那前50epoch是冻结训练,之后是UnFreeze_Train,它的显存开销很大,建议调低input_size。