使用完全连接层时发生ValueError

时间:2019-02-18 04:35:06

标签: python tensorflow image-processing keras valueerror

我将以下密集层作为我的最后一层。

flat = Flatten()(reduction_pose)

pose = Dense(1024, activation='relu', name='pose')(flat)

xyz = Dense(2, name='xyz')(pose)

model_out = Model(input=input, output=[xyz])

我想用完全连接的层替换密集层。我该怎么办?我尝试了以下方法,

conv10 = Convolution2D(2, (1, 1), name='conv_10_1')(reduction_pose)
x = Reshape((224 * 224, 2))(conv10)
x = Activation('softmax')(x)
outputs = Reshape((224, 224, 2))(x)

model_out = Model(inputs=input, outputs=outputs)

但是我遇到了以下错误,

  

ValueError:新数组的总大小必须保持不变

错误指向x = Reshape((224 * 224, 2))(conv10)

0 个答案:

没有答案
相关问题