【问题标题】:How to generate a model summary or plot the model architecture in Tensorflow object detection models?如何在 TensorFlow 对象检测模型中生成模型摘要或绘制模型架构?
【发布时间】:2021-02-05 13:04:37
【问题描述】:

是否可以查看模型摘要或绘制 TensorFlow 对象检测 git 存储库中可用的 TensorFlow 对象检测模型。例如查看 Faster R-CNN 模型的模型摘要?

【问题讨论】:

  • 我认为您不能在 keras utils 模型中使用 plot_model 进行绘图,因为保存的模型不是 keras 实例,因为模型是使用具有自定义签名的低级 tensorflow 函数保存的,也许您可​​以绘制模型使用张量板我不确定

标签: python tensorflow object-detection


【解决方案1】:

模型摘要可以通过使用 TensorFlow 中的 model.summary() 来查看。 请参阅示例代码。

# Create the base model from the pre-trained model MobileNet V2
IMG_SHAPE = IMG_SIZE + (3,)
base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE,
                                               include_top=False,
                                               weights='imagenet')

# Let's take a look at the base model architecture
base_model.summary()

#输出

Model: "mobilenetv2_1.00_160"
__________________________________________________________________________________________________
Layer (type)                    Output Shape         Param #     Connected to                     
==================================================================================================
input_1 (InputLayer)            [(None, 160, 160, 3) 0                                            
__________________________________________________________________________________________________
Conv1 (Conv2D)                  (None, 80, 80, 32)   864         input_1[0][0]                    
__________________________________________________________________________________________________
bn_Conv1 (BatchNormalization)   (None, 80, 80, 32)   128         Conv1[0][0]                      
__________________________________________________________________________________________________
Conv1_relu (ReLU)               (None, 80, 80, 32)   0           bn_Conv1[0][0]                   
__________________________________________________________________________________________________
expanded_conv_depthwise (Depthw (None, 80, 80, 32)   288         Conv1_relu[0][0]                 
__________________________________________________________________________________________________

【讨论】:

    猜你喜欢
    • 2019-12-13
    • 2020-06-03
    • 2021-12-16
    • 1970-01-01
    • 2019-11-09
    • 2020-11-02
    • 2018-05-20
    • 2018-03-30
    • 1970-01-01
    相关资源
    最近更新 更多