实验是利用CIFAR10模型,计算将图片分成10个分类的误差。一开始采用cpu模型来训练,迭代一个epoch需要50分钟,所以换成GPU模型,GPU有4G内存,结果刚加载模型显卡内存就溢出。
报错如下:
先用keras来计算网络的大小,参数的个数。
(50000, 32, 32, 3) (50000,) (10000, 32, 32, 3) (10000,)
sample: (512, 32, 32, 3) (512,) tf.Tensor(-1.0, shape=(), dtype=float32) tf.Tensor(1.0, shape=(), dtype=float32)
Model: "res_net_1"
_________________________________________________________________
Layer (type) Output Shape Param #
=========================================&#
Original: https://blog.csdn.net/qq_41166909/article/details/120809263
Author: andrew P
Title: 关于深度学习神经网络模型训练,参数过大,导致显卡内存溢出问题的总结
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/511670/
转载文章受原作者版权保护。转载请注明原作者出处!