更改Inception-v4体系结构以在Tensorflow中进行多标签分类

时间:2017-01-26 03:10:58

标签: tensorflow tf-slim

我正在处理图像标记和注释问题,只是图像可能包含多个对象。我想训练初始-v4进行多标签分类。我的训练数据将是一个图像,长度等于矢量数的矢量,如果图像中存在对象,则每个索引中的数据为1。例如,如果我有四个班级(人,车,树,建筑物)。如果图像包含人和汽车。然后我的矢量将是(1,1,0,0)。

我需要进行哪些更改才能为标记和注释问题培训初始-v4?

我是否只需要在inception-v4架构中更改输入格式并将损失函数从softmax更改为sigmoid_cross_entropy_with_logits?

https://github.com/tensorflow/models/blob/master/slim/nets/inception_v4.py

提前谢谢。

1 个答案:

答案 0 :(得分:-2)

如果您想重新培训模型以输出不同的标签,请查看image_retraining示例:https://github.com/tensorflow/tensorflow/blob/r1.1/tensorflow/examples/image_retraining/retrain.py

在该示例中,我们重新训练标准初始v3模型以识别鲜花而不是标准的ImageNet类别。