我正在尝试使用设置为无监督学习的图像来重新训练Inception-V4。 首先,我已经阅读了Inception-V4的预训练权重文件。
out = Dense(output_dim=nb_classes, activation='softmax')(x)
model = Model(init, out, name='Inception-v4')
if load_weights == True:
weights = checkpoint_custom_path
model.load_weights(weights, by_name=True)
print("Model weights loaded.")
return model
我删除了最终的完整连接层和密集层,以制作特征提取器。 接下来,我添加了一个新的卷积层以获取特殊的维特征向量形式模型。 然后我保存了模型并重新阅读。
model = create_inception_v4(load_weights=check)
model.summary()
model.layers.pop()
model.layers.pop()
model.summary()
x = conv_block(model.layers[-1].output, 512, 1, 1)
x = Flatten()(x)
out = Dense(output_dim=500, activation='softmax')(x)
out = Activation('sigmoid', name='loss')(out)
model2 = Model(input=model.input, output=[out])
model2.summary()
model2.save(checkpoint_custom_path)
model = create_custormized_inception_v4(nb_classes=500, load_weights=check_custom)
model.summary()
问题是要用我的图像数据集重新训练该模型。 但是我不知道每个图像的标签。 因此,我必须通过无监督学习来重新训练模型。 图像数据集的大小超过130K。 如何通过无监督学习来重新训练模型?