报错内容:export failure: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 2.45 GiB already allocated; 0 bytes free; 2.54 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
解决方法:
加入
import os
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "max_split_size_mb:128"
如果还不行,就在include-nms加上 这句文章来源:https://www.toymoban.com/news/detail-519210.html
default=['torchscript'],
文章来源地址https://www.toymoban.com/news/detail-519210.html
到了这里,关于yolov7的export.py转换时显存报错 If reserved memory is >> allocated memory try setting max_split_size_mb to a的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!