如何在张量流object_detection中检查训练/评估性能 [英] how to check both training/eval performances in tensorflow object_detection
问题描述
当我检查张量板以观察训练效果时,仅显示eval_0(蓝色)结果。
When I check the tensorboard for observing the training performance, there only shows the eval_0 (in blue) result.
虽然它应该是一列单独的火车(在橙色和eval(蓝色)结果显示在tensorboard网站上( https://www.tensorflow。 org / guide / summaries_and_tensorboard ?)。
While it should be a separate train (in orange) and eval (in blue) result as shown in the website of 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并想知道
So I checked the models/research/object_detection/model_main.py and want to know
如果II可以通过
根据火车和评估数据集获得精度,请将 model_dir 的标志设置为 model / eval 文件夹并将 eval_training_data 的
标志设置为 model / train 文件夹?
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.')
我对这句话感到困惑。
And I'm confused with this sentence.
请注意,一个呼叫仅在仅评估模式下使用,并且必须提供checkpoint_dir。
这是否意味着如果我只想在仅eval模式下运行它,那么我必须将
设置为checkpoint_dir吗?而且,如果我想同时在
中使用train和eval来运行它,我不需要设置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?
推荐答案
如果要根据验证数据评估模型,则应使用:
If you want to evaluate your model on validation data you should use:
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,即:
If you want to evaluate your model on training data, you should set 'eval_training_data' as True, that is:
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
我还添加了注释以阐明某些先前的选择:
I also add comments to clarify some of previous options:
-pipeline_config_path:用于训练检测模型的 pipeline.config文件的路径。该文件应包含您要评估的TFRecords文件(训练和测试文件)的路径,即:
--pipeline_config_path: path to "pipeline.config" file used to train detection model. This file should include paths to the TFRecords files (train and test files) that you want to evaluate, i.e. :
...
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 :将在其中写入结果度量的输出目录,尤其是可由tensorboard读取的事件。*文件。
--model_dir: Output directory where resulting metrics will be written, particularly "events.*" files that can be read by tensorboard.
-checkpoint_dir :Directo瑞恩拿着一个检查站。在训练过程中,或使用 export_inference_graph.py导出检查点文件后,即在其中写入检查点文件( model.ckpt。*)的模型目录。
--checkpoint_dir: Directory holding a checkpoint. That is the model directory where checkpoint files ("model.ckpt.*") has been written, either during training process, or after export it by using "export_inference_graph.py".
-run_once :仅运行一次评估即可。
--run_once: True to run just one round of evaluation.
这篇关于如何在张量流object_detection中检查训练/评估性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!