Skip to main content
 首页 » 编程设计

python之运行 eval.py tensorflow 对象检测 api 时出错

2024年08月14日26yjmyzz

当我运行 eval.py 脚本时,会评估图像,并且在日志中我可以看到还在图像上创建了可视化效果。

我在 pipeline.config 中将 num_examples 设置为 50。但是,未评估 50 张图像。在评估了大约 9 张图像(变化很大 - 有时 5 张,有时 4 张)之后,我得到一个错误,即 ValueError: Image with id 1531471339_visible.png already added.

我不确定我哪里出错了。

注意:这是我训练过的自己的数据集。 我也试过不同的机器,还是一样的错误。

评估配置:

eval_config { 
  num_examples: 50 
  use_moving_averages: false 
} 
eval_input_reader { 
  label_map_path: "/home/path/to/labelmap.pbtxt" 
  tf_record_input_reader { 
    input_path: "/home/path/to/file.tfrecord" 
  } 
} 

请您参考如下方法:

我收到了同样的错误信息。我通过添加解决了它

metrics_set:“coco_detection_metrics”

进入我的配置文件。

eval_config { 
  num_examples: 50 
  use_moving_averages: false 
  metrics_set: "coco_detection_metrics" 
} 

然后错误消息消失了...不知道为什么。也许你可以试一试。让我知道是否有帮助。