【发布时间】:2017-08-14 04:55:04
【问题描述】:
我有一个问题,同时也是一个问题。我想用 Keras 制作一个图像分类器,使用 Theano 作为后端和一个顺序模型。
>>> keras.__version__
'2.0.1'
>>> theano.__version__
'0.9.0'
我的输入形状:INPUT_SHAPE = (3, 28, 28) #depth, size, size
让我们来解决我的问题。如果我在 Windows 7 32 位上运行我的脚本,它会给我以下错误:
ValueError: ('The specified size contains a dimension with value <= 0', (-1024, 512))
如果使用输入形状运行它:INPUT_SHAPE = (28, 28, 3) #size, size, depth
它在下面给了我这个错误:
ValueError: Error when checking model input: expected conv2d_1_input to have shape (None, 48, 48, 3) but got array with shape (1000, 3, 48, 48)
如果我在 Elementary OS 64 位上运行代码,它运行没有任何问题 (INPUT_SHAPE = (3, 28, 28))。
我的 windows keras.json 文件是:
{
"backend": "theano",
"epsilon": 1e-07,
"floatx": "float32",
"image_dim_ordering": "tf"
}
所以,我的问题是:不同操作系统之间是否存在如此大的差异,或者我的错误在哪里?提醒一下,我对两个系统都使用了完全相同的代码。
【问题讨论】:
标签: python machine-learning theano keras