python - 由于没有使用标签,如何重新训练 TFHub 模块?
问题描述
这是 TensorFlow Hub 模块的链接: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 集线器模块中是如何工作的?
非常感谢。
解决方案
logits = module(inputs=dict(images=images, batch_norm_momentum=0.997),
signature="image_classification_with_bn_hparams")
上述部分由作为索引的类标签组成。您可以在Usage中阅读有关它的信息。
logits 的索引是来自原始训练的分类的 num_classes = 1001 个类
推荐阅读
- postgresql - 如何按顺序显示链元素
- c# - 无法从 C# 中的 HEX 获取负浮点值
- node.js - 如何从 Windows NodeJS 进程运行多个 WSL 命令?
- c# - Windows 窗体未处理的异常崩溃
- javascript - 我正在尝试使用 fullCalender 制作 Timesheet Web 应用程序
- android - CSV 查询与颤动
- c# - 将(一些)Unicode非间距标记与相关字母组合以进行统一处理
- c# - 如何在 XmlDocument.Load() 中使用长路径?
- c - 绘制连接 2 个点的像素
- unity3d - 了解 Unity 3D 的 aws-sdk-net