【发布时间】:2021-04-15 06:10:20
【问题描述】:
我有一个训练有素的 CRNN 模型,它应该能够识别图像中的文本。
它真的很有效,到目前为止一切都很好。
我的输出是一个 CTC 损失层,我使用 tensorflow 函数 keras.backend.ctc_decode 对其进行解码,如文档所述 (https://code.i-harness.com/en/docs/tensorflow~python/tf/keras/backend/ctc_decode),该函数返回一个带有解码结果的 Tuple 和一个带有日志的 Tensor预测的概率。
通过对模型进行一些测试,我得到了以下结果:
True value: test0, prediction: test0, log_p: 1.841524362564087
True value: test1, prediction: test1, log_p: 0.9661365151405334
True value: test2, prediction: test2, log_p: 1.0634151697158813
True value: test3, prediction: test3, log_p: 2.471940755844116
True value: test4, prediction: test4, log_p: 1.4866207838058472
True value: test5, prediction: test5, log_p: 0.7630811333656311
True value: test6, prediction: test6, log_p: 0.35642576217651367
True value: test7, prediction: test7, log_p: 1.5693446397781372
True value: test8, prediction: test8, log_p: 0.9700028896331787
True value: test9, prediction: test9, log_p: 1.4783780574798584
预测总是正确的。然而,我认为它的可能性似乎不是我所期望的。它们看起来完全是随机数,甚至比 1 或 2 还要大!我做错了什么??
【问题讨论】:
标签: tensorflow machine-learning keras conv-neural-network ctc