Keras功能模型摘要

时间:2018-12-17 16:50:26

标签: python-3.x keras

我正在修改Xception模型以使用ImageNet权重,但使用自己的类数。我这样做是这样的:

image_input = Input(shape=(None, None, 3), name='image_input')
x = Lambda(lambda image: tf.image.resize_images(image, (128, 128)))(image_input)
x = Xception(include_top=False)(x)
x = GlobalAveragePooling2D(name='avg_pool')(x)
x = Dense(NUM_CLASSES, activation='softmax', name='predictions')(x)
model = Model(inputs=image_input, outputs=x)
print(model.summary()) 

当我打印model.summary()时,我得到的输出是:

 _________________________________________________________________
 Layer (type)                 Output Shape              Param #   
 =================================================================
 image_input (InputLayer)     (None, None, None, 3)     0         
 _________________________________________________________________
 lambda (Lambda)              (None, 128, 128, 3)       0         
 _________________________________________________________________
 xception (Model)             multiple                  20861480  
 _________________________________________________________________
 avg_pool (GlobalAveragePooli (None, 2048)              0         
 _________________________________________________________________
 predictions (Dense)          (None, 10)                20490     
 =================================================================
 Total params: 20,881,970
 Trainable params: 20,827,442
 Non-trainable params: 54,528
 _________________________________________________________________
 None

那么有什么方法可以使摘要包含有关Xception网络各层的中间信息?

0 个答案:

没有答案