【发布时间】:2018-02-17 15:27:59
【问题描述】:
我正在使用 Retinanet 模型来训练一个包含大约 50 个类的分类器。模型链接:https://github.com/fizyr/keras-retinanet
这是我到目前为止所做的:
- 使用建议的步骤安装模型。
- 使用推荐的阅读格式创建我的图像的 csv。
-
使用以下脚本训练我的模型:
# Using the installed script: retinanet-train csv <path to csv file containing annotations> <path to csv file containing classes> 该模型当前正在运行和训练,每个 epoch 大约有 50 个 epoch 和 10000 步。我看到损失在减少,大约需要一天的时间才能完成训练。
我现在该如何处理:
一个。测试我的模型?这里给出的例子:
一个测试网络的例子可以在这个(https://github.com/fizyr/keras-retinanet/blob/master/examples/ResNet50RetinaNet.ipynb网站上的链接已经死了,这似乎合适)笔记本中看到。一般来说,可以从网络中检索输出,如下所示:
_, _, detections = model.predict_on_batch(inputs)
其中检测结果是检测结果,形状为 (None, None, 4 + num_classes)(对于 (x1, y1, x2, y2, cls1, cls2, ...))。
可以通过以下方式加载模型:
from keras_retinanet.models.resnet import custom_objects
model = keras.models.load_model('/path/to/model.h5',
custom_objects=custom_objects)
对于形状为 1000x600x3 的图像,NVIDIA Pascal Titan X 的执行时间大约为 55 毫秒。
现在在训练期间,我在运行我的模型时没有做任何事情:
为训练和测试数据创建生成器(示例显示在 keras_retinanet.preprocessing.PascalVocGenerator 中)。
我错过了什么吗?
再次,对于多方面的问题,我们深表歉意,并感谢您帮助我。
【问题讨论】:
标签: tensorflow keras