【发布时间】:2018-07-18 14:29:06
【问题描述】:
Resource exhausted: OOM when allocating tensor with shape[256,128,3,3] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
在这里,我尝试使用 vgg 来学习使用 Fast.ai 课程的深度学习概念。当我尝试读取 4 张图像的小数据时,它也会显示上述空间中给出的错误。这是我正在使用的 vgg16 文件的链接: https://github.com/fastai/courses/blob/master/deeplearning1/nbs/vgg16.py
我在下面代码中的路径是示例数据的路径,其中仅包含 4-5 张图像。
path = "data/dogscats/sample/"
import vgg16
from vgg16 import Vgg16
batch_size = 4
vgg = Vgg16()
# Grab a few images at a time for training and validation.
# NB: They must be in subdirectories named based on their category
#batches = vgg.get_batches(path+'train', batch_size=batch_size)
val_batches = vgg.get_batches(path+'valid', batch_size=batch_size*2)
vgg.finetune(batches)
vgg.fit(batches, val_batches, nb_epoch=1)
【问题讨论】:
-
您应该补充说您使用的是“Quadro m1000m 4GB GPU”
-
对不起@MartinThoma 那么现在如何解决这个问题。
-
尝试在 CPU 上执行。发生什么了?您收到哪个错误消息? (请将此添加到问题中!)
标签: python-3.x tensorflow deep-learning gpu theano