使用ctc_batch_cost
时计算出的精度是什么,模型输出丢失了,我不明白精度是如何计算的
def ctc_lambda_func(args):
y_pred,labels,input_length,label_length = args
return K.ctc_batch_cost(labels, y_pred, input_length, label_length)
input_x = Input(tensor=image,name='image')
labels = Input(name='ctc_label',tensor=ctc_label,dtype='int64')
input_length = Input(name='input_length', tensor=input_length, dtype='int64')
label_length = Input(name='label_length', tensor=label_length, dtype='int64')
loss_out = Lambda(ctc_lambda_func, output_shape=(1,), name='ctc')([y_pred, labels, input_length, label_length])
model = Model(inputs=[input_x, labels, input_length, label_length], outputs=loss_out)
adam = Adam()
model.compile(loss={'ctc': lambda y_true, y_pred: y_pred},target_tensors=[output], optimizer=adam,metrics=['accuracy'])
答案 0 :(得分:0)
使用ctc_batch_cost时如何计算准确性