赞
踩
RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 2.41 GiB already allocated; 5.70 MiB free; 2.56 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
batch_size过大,导致内存容量撑不住了。
通过打开任务管理器,我们很清楚的发现,原因就是内存容量不足,导致报错。
减小batch_size
正常运行:
任务管理器检测情况:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。