keras实现CRF层遇到的问题:3D张量的报错

keras实现CRF层遇到的问题:3D张量的报错

问题:在使用CRF层构建模型进行训练时,总是报错:

下面是ValueError的完整信息:

ValueError: Index out of range using input dim 2; input has only 2 dims for 'loss/crf_1_loss/strided_slice' (op: 'StridedSlice') with input shapes: [?,?], [3], [3], [3] and with computed input tensors: input[3] = <1 1 1>.    

是张量的shape问题。具体的原因还需要进一步查找,先标记下,五一假后解决。

-------------本文结束感谢您的阅读-------------
0%