Yue*_*Yue 8 object detection tensorflow
当我检查张量板以观察训练性能时,只显示了 eval_0(蓝色)结果。
虽然它应该是一个单独的火车(橙色)和 eval(蓝色)结果,如 tensorboard 的网站(https://www.tensorflow.org/guide/summaries_and_tensorboard ?)所示。
但是,我想比较训练数据集和评估数据集的模型性能。
所以我查了models/research/object_detection/model_main.py,想知道
如果II可以通过将model_dir的标志设置为model/eval文件夹并将eval_training_data的标志设置为model/train文件夹来获得基于train和eval数据集的精度?
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.')
Run Code Online (Sandbox Code Playgroud)
我对这句话感到困惑。
请注意,一次调用仅在 eval-only 模式下使用它,并且必须提供 checkpoint_dir。
这是否意味着如果我只想在 eval-only 模式下运行它,那么我必须设置 checkpoint_dir?如果我想同时使用 train 和 eval 运行它,我不需要设置 checkpoint_dir?
小智 3
如果您想根据验证数据评估模型,您应该使用:
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
Run Code Online (Sandbox Code Playgroud)
如果你想在训练数据上评估你的模型,你应该将 '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
Run Code Online (Sandbox Code Playgroud)
我还添加评论来澄清之前的一些选项:
--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"
}
...
Run Code Online (Sandbox Code Playgroud)
--model_dir:将写入结果指标的输出目录,特别是可由张量板读取的“events.*”文件。
--checkpoint_dir:保存检查点的目录。这是在训练过程中或使用“export_inference_graph.py”导出后写入检查点文件(“model.ckpt.*”)的模型目录。
--run_once:如果为 True,则仅运行一轮评估。
归档时间: |
|
查看次数: |
1247 次 |
最近记录: |