当我检查张量板以观察训练性能时,只显示了 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?
尝试使用最近发布的Tensorflow对象检测API,想知道如何评估他们在模型动物园中提供的一种预训练模型?例如 如何获得该预训练模型的mAP值?
由于他们提供的脚本似乎使用了检查点(根据他们的文档),所以我尝试制作一个检查点的哑副本,该检查点指向model.ckpt.data-00000-of-00001其模型动物园中提供的模型,但eval.py不喜欢这样。
checkpoint
model_checkpoint_path: "model.ckpt.data-00000-of-00001"
Run Code Online (Sandbox Code Playgroud)
我曾考虑过对经过预训练的人进行短暂的训练,然后对其进行评估……但是我不确定这是否能为我提供正确的指标。
抱歉,这是一个基本问题-我刚开始使用Tensorflow,并想验证我是否得到了正确的信息。将不胜感激任何指针!
编辑:
我根据乔纳森的回答做了一个检查点文件:
model_checkpoint_path: "model.ckpt"
all_model_checkpoint_paths: "model.ckpt"
Run Code Online (Sandbox Code Playgroud)
评估脚本所使用的内容,并使用COCO数据集进行评估。但是评估停止了,并说形状不匹配:
...
[[Node: save/Assign_19 = Assign[T=DT_FLOAT, _class=["loc:@BoxPredictor_4/ClassPredictor/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](BoxPredictor_4/ClassPredictor/weights, save/RestoreV2_19/_15)]]
2017-07-05 18:40:11.969641: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,256,486] rhs shape= [1,1,256,546]
[[Node: save/Assign_19 = Assign[T=DT_FLOAT, _class=["loc:@BoxPredictor_4/ClassPredictor/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](BoxPredictor_4/ClassPredictor/weights, save/RestoreV2_19/_15)]]
2017-07-05 18:40:11.969725: W tensorflow/core/framework/op_kernel.cc:1158]
...
Invalid argument: Assign requires shapes of both tensors to match. lhs shape= [1,1,256,486] rhs shape= …Run Code Online (Sandbox Code Playgroud)