gpt4 book ai didi

object - 如何在 tensorflow object_detection 中检查训练/评估性能

转载 作者:行者123 更新时间:2023-12-03 17:26:02 28 4
gpt4 key购买 nike

当我检查张量板以观察训练性能时,只显示了 eval_0(蓝色)结果。

enter image description here

虽然它应该是一个单独的火车(橙色)和 eval(蓝色)结果,如 tensorboard 的网站(https://www.tensorflow.org/guide/summaries_and_tensorboard?)所示。

However, I want to compare the model performance on training dataset and eval dataset.



所以我查了models/research/object_detection/model_main.py,想知道

if I I can get the precision based on the train and eval dataset by set the flag of model_dir to model/eval folder and set the flag of eval_training_data to model/train folder?


flags.DEFINE_string('model_dir', None, 'Path to output model directory '
'where event and checkpoint files will be written.')

flags.DEFINE_boolean('eval_training_data', False,
'If training data should be evaluated for this job. Note '
'that one call only use this in eval-only mode, and '
'`checkpoint_dir` must be supplied.')

我对这句话感到困惑。

请注意,一次调用仅在 eval-only 模式下使用它,并且必须提供 checkpoint_dir。

Does it means if I just want run it in eval-only mode, then I must set the checkpoint_dir? And if I want to run it with train and eval at the same time, I don't need to set the checkpoint_dir?

最佳答案

如果您想在验证数据上评估您的模型,您应该使用:

python models/research/object_detection/model_main.py --pipeline_config_path=/path/to/pipeline_file --model_dir=/path/to/output_results --checkpoint_dir=/path/to/directory_holding_checkpoint --run_once=True

如果你想在训练数据上评估你的模型,你应该将 'eval_training_data' 设置为 True,即:
python models/research/object_detection/model_main.py --pipeline_config_path=/path/to/pipeline_file --model_dir=/path/to/output_results --eval_training_data=True --checkpoint_dir=/path/to/directory_holding_checkpoint --run_once=True

我还添加了注释以澄清以前的一些选项:

--pipeline_config_path: 用于训练检测模型的“pipeline.config”文件的路径。此文件应包含要评估的 TFRecords 文件(训练和测试文件)的路径,即:
    ...
train_input_reader: {
tf_record_input_reader {
#path to the training TFRecord
input_path: "/path/to/train.record"
}
#path to the label map
label_map_path: "/path/to/label_map.pbtxt"
}
...
eval_input_reader: {
tf_record_input_reader {
#path to the testing TFRecord
input_path: "/path/to/test.record"
}
#path to the label map
label_map_path: "/path/to/label_map.pbtxt"
}
...

--model_dir :将写入结果指标的输出目录,特别是可以由张量板读取的“events.*”文件。

--checkpoint_dir : 持有检查点的目录。这是在训练过程中或使用“export_inference_graph.py”导出后写入检查点文件(“model.ckpt.*”)的模型目录。

--run_once : True 只运行一轮评估。

关于object - 如何在 tensorflow object_detection 中检查训练/评估性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53663384/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com