我有一个这样的神经网络:
model = Sequential()
model.add(Conv1D(100, 10, activation='relu', batch_input_shape=25)))
model.add(Conv1D(100, 10, activation='relu'))
model.add(MaxPool1D(3))
model.add(Conv1D(160, 10, activation='relu'))
model.add(GlobalAveragePooling1D())
model.add(layers.Dense(60))
我的生成器生成形状(20,60,1)的批目标。我有两个问题
ValueError: Error when checking target: expected dense_1 to have 2 dimensions, but got array with shape (20, 60, 1)
当我这样做的时候
model.add(layers.Reshape((20,60,1)))
我得到以下错误:
ValueError: Cannot reshape a tensor with 1200 elements to shape [20,20,60,1] (24000 elements) for 'reshape_1/Reshape' (op: 'Reshape') with input shapes: [20,60], [4] and with input tensors computed as partial shapes: input[1] = [20,20,60,1].
为什么它要这样做呢
目前没有回答
相关问题 更多 >
编程相关推荐