【发布时间】:2017-12-29 14:21:05
【问题描述】:
我正在尝试使用 CNN 训练一些数据。
x_train.shape
(67197, 99, 81, 1)
y_train.shape
(67197, 12)
并尝试使用 Keras 的 Resnet 方法
import keras
import keras_resnet.models
input_shape = (98,81,1)
nclass = 12
x = keras.layers.Input(input_shape)
model = keras_resnet.models.ResNet50(x,classes=nclass)
model.compile("adam","categorical_crossentropy",["accuracy"])
model.fit(x_train,y_train,
batch_size = 300,
nb_epoch=5,
validation_data = (x_test,y_test),
shuffle = True,
)
但我遇到了一些形状错误。
ValueError: Error when checking input: expected input_3 to have shape (None, 98, 81, 1) but got array with shape (67197, 99, 81, 1)
【问题讨论】:
-
如果答案解决了您的问题,请接受(答案会占用受访者宝贵的时间)
标签: neural-network keras conv-neural-network resnet