由于没有使用标签,如何重新培训TFHub模块?

2024-05-17 00:01:32 发布

您现在位置:Python中文网/ 问答频道 /正文

这里是指向TensorFlow中心模块的链接:imagenet/mobilenet_v1_050_160/classification。在微调示例代码中:

module = hub.Module("https://tfhub.dev/google/imagenet/mobilenet_v1_050_160/classification/3",
                    trainable=True, tags={"train"})
logits = module(inputs=dict(images=images, batch_norm_momentum=0.997),
                signature="image_classification_with_bn_hparams")

似乎输入只包含图像,没有标签。我设法得到了输入信息,结果发现输入只有两个元素:输入图像批量标准动量

因此,我想知道如果没有标签输入,如何重新培训/微调此模块?

我希望有人能告诉我在这个TensorFlow hub模块中,批处理规范动量是如何工作的

非常感谢


Tags: 模块图像tensorflow标签中心动量hub指向
1条回答
网友
1楼 · 发布于 2024-05-17 00:01:32

logits = module(inputs=dict(images=images, batch_norm_momentum=0.997), signature="image_classification_with_bn_hparams")

以上部分由类标签作为索引组成。你可以在用法中here阅读

The indices into logits are the num_classes = 1001 classes of the classification from the original training

相关问题 更多 >