重新训练 Inception 并指定 label_count = 2 但收到三个分数而不是两个
Retraining Inception and specifying label_count = 2 but receiving three scores instead of two
我已将 flower retraining code 修改为 label_count =2,如下所示:
gcloud beta ml jobs submit training "$JOB_ID" \
--module-name trainer.task \
--package-path trainer \
--staging-bucket "$BUCKET" \
--region us-central1 \
-- \
--output_path "${GCS_PATH}/training" \
--eval_data_paths "${GCS_PATH}/preproc/eval*" \
--train_data_paths "${GCS_PATH}/preproc/train*" \
--label_count 2 \
--max_steps 4000
而且我修改了 dict.txt 只有两个标签。
但是重新训练的模型输出三个分数而不是预期的两个。意外的第三个分数总是很小,如本例所示:
关键预测得分
Key123 0 [0.7956143617630005, 0.2043769806623459, 8.625334885437042e-06]
为什么有三个分数,是否可以进行更改,使模型只输出两个分数?
注意:我已经阅读了 Slaven Bilac 和 JoshGC 对“”问题的回答,但这些回答没有解决我上面的问题。
这是我们应用于训练集中没有标签的图像的"label"。该行为在 model.py 第 221 行
的评论中进行了讨论
# Some images may have no labels. For those, we assume a default
# label. So the number of labels is label_count+1 for the default
# label.
我同意这不是一个非常直观的行为,但它使代码对于未清理的数据集更加健壮!希望这可以帮助。
我已将 flower retraining code 修改为 label_count =2,如下所示:
gcloud beta ml jobs submit training "$JOB_ID" \
--module-name trainer.task \
--package-path trainer \
--staging-bucket "$BUCKET" \
--region us-central1 \
-- \
--output_path "${GCS_PATH}/training" \
--eval_data_paths "${GCS_PATH}/preproc/eval*" \
--train_data_paths "${GCS_PATH}/preproc/train*" \
--label_count 2 \
--max_steps 4000
而且我修改了 dict.txt 只有两个标签。
但是重新训练的模型输出三个分数而不是预期的两个。意外的第三个分数总是很小,如本例所示:
关键预测得分
Key123 0 [0.7956143617630005, 0.2043769806623459, 8.625334885437042e-06]
为什么有三个分数,是否可以进行更改,使模型只输出两个分数?
注意:我已经阅读了 Slaven Bilac 和 JoshGC 对“
这是我们应用于训练集中没有标签的图像的"label"。该行为在 model.py 第 221 行
的评论中进行了讨论 # Some images may have no labels. For those, we assume a default
# label. So the number of labels is label_count+1 for the default
# label.
我同意这不是一个非常直观的行为,但它使代码对于未清理的数据集更加健壮!希望这可以帮助。