【问题标题】:tensorflow slim modify resnet modeltensorflow slim 修改 resnet 模型
【发布时间】:2018-10-04 06:20:58
【问题描述】:

我想修改 resnet_v2.resnet_v2_50 模型,以便将一个数字连接到 pool5 层。 导入网络后,我可以在 end_points 变量中看到图层。

    with slim.arg_scope(resnet_v2.resnet_arg_scope()):
        net, end_points = resnet_v2.resnet_v2_50(self.imageIn, num_classes = numClasses)

所以我可以访问不同的层

curr_conv1 = end_points['resnet_v2_50/conv1']
curr_pred = end_points['resnet_v2_50/predictions']
curr_block4 = end_points['mainQN/resnet_v2_50/block4/unit_3/bottleneck_v2']

但是我无法访问池化层之后网络的最后一部分。

curr_pool5 = end_points['resnet_v2_50/pool5']

但是我可以在 Tensorboard 和 resnet_v2_50 的代码中看到有某种 pool5 层。我怎样才能访问它,以便修改它并将数字连接到它?

【问题讨论】:

    标签: python tensorflow tensorflow-slim


    【解决方案1】:
    end_points['global_pool']
    

    是你想要的。紧跟在代码中称为 pool5 的全局池化层之后。

    https://github.com/tensorflow/models/blob/master/research/slim/nets/resnet_v2.py#L214

    【讨论】:

      猜你喜欢
      • 2018-07-25
      • 2018-01-22
      • 2018-11-08
      • 2018-10-12
      • 2020-04-24
      • 2021-06-09
      • 2018-02-02
      • 1970-01-01
      • 2019-05-29
      相关资源
      最近更新 更多