【问题标题】:How to train inception v3 model for multilabel classification?如何训练 inception v3 模型进行多标签分类?
【发布时间】:2017-08-17 02:33:04
【问题描述】:

我正在尝试构建一个模型来检测图像中的多个属性。

我使用的是预训练的 Inception V3 模型。我知道我们必须将最终的 softmax 层更改为 sigmoid。

我正在加载模型如下:

with slim.arg_scope(inception.inception_v3_arg_scope()):
                logits, _ = inception.inception_v3(images, num_classes=numClass, is_training=True)

现在如何将 softmax 层更改为 sigmoid?

【问题讨论】:

标签: tensorflow multilabel-classification tf-slim


【解决方案1】:

如果您检查 inception_v3 的源代码,您将看到可用的完整参数:

def inception_v3(inputs,
                 num_classes=1000,
                 is_training=True,
                 dropout_keep_prob=0.8,
                 min_depth=16,
                 depth_multiplier=1.0,
                 prediction_fn=slim.softmax,
                 spatial_squeeze=True,
                 reuse=None,
                 scope='InceptionV3'):

只需更改为prediction_fn=tf.sigmoid

【讨论】:

    猜你喜欢
    • 2017-03-28
    • 2023-03-25
    • 2019-05-19
    • 1970-01-01
    • 2018-03-10
    • 1970-01-01
    • 1970-01-01
    • 2017-03-09
    • 1970-01-01
    相关资源
    最近更新 更多