自定义图片数据集训练好的model做分类预测不了,输出都是一样的结果
Created by: yeyupiaoling
我用自己做的数据进行训练,一切都是正常的,但是就是在使用model.tar预测分类图片时,就是预测不了 我训练的日志是:
Pass 0, Batch 0, Cost 0.021700, {'classification_error_evaluator': 0.0078125}
.
Test with Pass 0, {'classification_error_evaluator': 0.05076142027974129}
Pass 1, Batch 0, Cost 0.044308, {'classification_error_evaluator': 0.03125}
.
Test with Pass 1, {'classification_error_evaluator': 0.0}
Pass 2, Batch 0, Cost 0.004998, {'classification_error_evaluator': 0.0}
.
Test with Pass 2, {'classification_error_evaluator': 0.0}
Pass 3, Batch 0, Cost 0.048880, {'classification_error_evaluator': 0.015625}
.
Test with Pass 3, {'classification_error_evaluator': 0.0}
Pass 4, Batch 0, Cost 0.002858, {'classification_error_evaluator': 0.0}
.
Test with Pass 4, {'classification_error_evaluator': 0.020304568111896515}
Pass 5, Batch 0, Cost 0.032972, {'classification_error_evaluator': 0.0078125}
.
Test with Pass 5, {'classification_error_evaluator': 0.04568528011441231}
Pass 6, Batch 0, Cost 0.001908, {'classification_error_evaluator': 0.0}
.
Test with Pass 6, {'classification_error_evaluator': 0.04060913622379303}
Pass 7, Batch 0, Cost 0.000829, {'classification_error_evaluator': 0.0}
.
Test with Pass 7, {'classification_error_evaluator': 0.03553299605846405}
Pass 8, Batch 0, Cost 0.002944, {'classification_error_evaluator': 0.0}
.
Test with Pass 8, {'classification_error_evaluator': 0.030456852167844772}
Pass 9, Batch 0, Cost 0.006166, {'classification_error_evaluator': 0.0}
.
Test with Pass 9, {'classification_error_evaluator': 0.010152284055948257}
看到的训练结果的准确率也是挺高的,但是我在预测结果都是一样的,明明是不同类别的图片:
[[ 1.00000000e+00 1.60381094e-28 1.60381094e-28]
[ 1.00000000e+00 1.60381094e-28 1.60381094e-28]
[ 1.00000000e+00 1.60381094e-28 1.60381094e-28]]
[[0 1 2]
[0 1 2]
[0 1 2]]
项目的GitHub地址:https://github.com/yeyupiaoling/TestImagesClassify