Machine learning Tensorflow模型/slim eval_image_classifier.py评估错误的图像数

Machine learning Tensorflow模型/slim eval_image_classifier.py评估错误的图像数,machine-learning,tensorflow,neural-network,deep-learning,conv-neural-network,Machine Learning,Tensorflow,Neural Network,Deep Learning,Conv Neural Network,我按照流程对Flowers数据集的inception模型进行了微调 flowers数据集在flowers.py文件中指定了350个验证图像 但当我运行并修改它以打印TP、FP、TN、FN的编号时 结果是: I tensorflow/core/kernels/logging_ops.cc:79] eval/TrueNegatives[64] I tensorflow/core/kernels/logging_ops.cc:79] eval/TruePositives[286] I tensorfl

我按照流程对Flowers数据集的inception模型进行了微调

flowers数据集在flowers.py文件中指定了350个验证图像

但当我运行并修改它以打印TP、FP、TN、FN的编号时

结果是:

I tensorflow/core/kernels/logging_ops.cc:79] eval/TrueNegatives[64]
I tensorflow/core/kernels/logging_ops.cc:79] eval/TruePositives[286]
I tensorflow/core/kernels/logging_ops.cc:79] eval/FalsePositives[2]
I tensorflow/core/kernels/logging_ops.cc:79] eval/FalseNegatives[48]
如果你把它们加起来,总数是400。但是验证图像的数量是350

我对自定义数据集进行了微调,其中验证图像为150个,只有两个类

结果是:

I tensorflow/core/kernels/logging_ops.cc:79] eval/TruePositives[11]
I tensorflow/core/kernels/logging_ops.cc:79] eval/TrueNegatives[155]
I tensorflow/core/kernels/logging_ops.cc:79] eval/FalsePositives[4]
I tensorflow/core/kernels/logging_ops.cc:79] eval/FalseNegatives[30]
I tensorflow/core/kernels/logging_ops.cc:79] eval/Accuracy[0.83]
I tensorflow/core/kernels/logging_ops.cc:79] eval/AreaUnderCurve[0.62156773]
如果你把它们加起来,结果是200

为什么会这样?额外的50张图片来自哪里

是否有方法修改eval_image_classifier.py以打印验证图像的名称及其预测和标签


我也曾就models/slim github提出过这个问题,但我没有收到任何回应

图像不匹配数量的原因是程序使用的输入队列。它通过批处理提供值。您需要根据数据集大小设置批次大小和数量批次来解决此问题


默认值为四舍五入上限

确定,谢谢。我试试看。对于我的自定义数据集,我有150个图像。所以我必须更改batch_size=75?您可以将batch_size设置为任何数字,只要您与num_batches参数同步。