转载地址:https://bbs.huaweicloud.com/forum/thread-91683-1-1.html
作者:青桃
一. 运行环境
MindSpore版本号:1.0.0;
硬件平台:GPU;
Python版本号:3.7.5;
操作系统:linux Ubuntu
二. 脚本信息
下载https://gitee.com/mindspore/mindspore.git仓库,修改model_zoo/official/cv/retinaface_resnet50/src/config.py中的batch_size为32,测试对不同batch_size的支持以及上限。
运行model_zoo/official/cv/retinaface_resnet50/单P和多P脚本。
单P运行成功,多P报错(单P目前有内存换入换出功能的支持,可以跑更大的batch_size)。
三. 报错信息
四. 解决方法
减小batch_size为16,多P脚本能够正常运行。
五. 总结
会导致device 内存不够用的场景:1、batch_size过大;2、模型过大;3、输入的数据shape太大;4、引入异常大的parameter等都会造成device内存不够用。
在Ascend上报错稍微有区别:Ascend平台上device内存不足时出现的报错:Out of Memory!!! total[3212254720] (dynamic[0] memory poll[524288000]) malloc[32611480064] failed!
华为邮箱:zhouqingtao2@huawei.com