如何在Tensorflow Object Detection API上评估我训练有素的模型?

问题描述 投票:1回答:1

我已经使用Tensorflow的对象检测API训练了模型,并且在Tensorboard上看到了评估结果。

现在,我需要使用新的测试数据来运行另一个仅评估运行。

我确实搜索过文档以及其他stackoverflow问题,但我找不到正确的方法,只有传统模式对我不起作用。

如何正确地做到这一点?

tensorflow evaluation object-detection-api
1个回答
0
投票

您还可以使用model_main.py评估模型。

如果要根据验证数据评估模型,则应使用:

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:将在其中写入结果度量的输出目录,尤其是可由tensorboard读取的“ events。*”文件。

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

-run_once:如果仅运行一轮评估,则为true。

© www.soinside.com 2019 - 2024. All rights reserved.