def build_image_model():
base_model = InceptionV3(weights='imagenet', include_top=False)
# Freeze Inception's weights - we don't want to train these
for layer in base_model.layers:
layer.trainable = False
# add a fully connected layer after Inception - we do want to train these
x = base_model.output
x = GlobalAveragePooling2D()(x)
x = Dense(2048, activation='relu')(x)
return x, base_model.input
# Build the two models.
评论列表
文章目录