【发布时间】:2019-11-28 01:38:15
【问题描述】:
我正在 Keras 中构建一个简单的“猫对狗分类器”。在安装ImageDataGenerator 时,我得到了MemoryError。我的代码如下所示:
from keras.preprocessing.image import ImageDataGenerator
image_gen = ImageDataGenerator(shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True)
image_gen.fit(X)
X 的形状为(25000,150,150,3)
我做错了什么或如何解决这个问题?
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-10-2fd88662a693> in <module>
----> 1 image_gen.fit(X)
/opt/conda/lib/python3.6/site-packages/keras_preprocessing/image/image_data_generator.py in fit(self, x, augment, rounds, seed)
943 np.random.seed(seed)
944
--> 945 x = np.copy(x)
946 if augment:
947 ax = np.zeros(
/opt/conda/lib/python3.6/site-packages/numpy/lib/function_base.py in copy(a, order)
790
791 """
--> 792 return array(a, order=order, copy=True)
793
794 # Basic operations
MemoryError:
【问题讨论】:
标签: python tensorflow keras