我正在训练具有以下结构和参数的分类器:
dense
除dense
层以外的所有层均取自其他模型。这里仅for layer in classifier.layers[:-4]:
layer.trainable = False
classifier.fit(x_train, y_train,
epochs=50,
batch_size=8,
validation_data=(x_val, y_val)
)
classifier.save_weights('cnn_hhar.h5')
层参数是可训练的。这是培训的代码段:
InvalidArgumentError: Incompatible shapes: [32] vs. [4536]
[[{{node logistic_loss/mul}}]]
但是我得到这个gem 'activestorage-validator'
此代码有什么问题?
编辑: 该代码here可用。它基本上是从变体自动编码器的代码改编而来的。我加入了编码器部分,并在其中添加了FC层以完成分类任务。