简体   繁体   English

无效参数:在 null label 之后看到非空 label(索引 >= num_classes - 1)

[英]Invalid argument: Saw a non-null label (index >= num_classes - 1) following a null label

Im getting the following error while doing CTC training:我在进行 CTC 培训时遇到以下错误:

InvalidArgumentError: 2 root error(s) found. InvalidArgumentError:找到 2 个根错误。 (0) Invalid argument: Saw a non-null label (index >= num_classes - 1) following a null label, batch: 0 num_classes: 40 labels: 35,4,6,18,8,36,29,37,38,39,40,0 labels seen so far: 35,4,6,18,8,36,29,37,38 [[node CTC-MODEL/ctc/CTCLoss (defined at:18) ]] (1) Invalid argument: Saw a non-null label (index >= num_classes - 1) following a null label, batch: 0 num_classes: 40 labels: 35,4,6,18,8,36,29,37,38,39,40,0 labels seen so far: 35,4,6,18,8,36,29,37,38 [[node CTC-MODEL/ctc/CTCLoss (defined at:18) ]] [[gradient_tape/CTC-MODEL/ctc/Shape/_72]] 0 successful operations. (0) Invalid argument: Saw a non-null label (index >= num_classes - 1) following a null label, batch: 0 num_classes: 40 labels: 35,4,6,18,8,36,29,37,38目前看到的,39,40,0 个标签:35,4,6,18,8,36,29,37,38 [[node CTC-MODEL/ctc/CTCLoss (defined at:18)]] (1) 无效argument: Saw a non-null label (index >= num_classes - 1) following a null label, batch: 0 num_classes: 40 labels: 35,4,6,18,8,36,29,37,38,39,40 ,0 个标签到目前为止看到:35,4,6,18,8,36,29,37,38 [[node CTC-MODEL/ctc/CTCLoss (defined at:18)]] [[gradient_tape/CTC-MODEL/ ctc/Shape/_72]] 0 次成功操作。 0 derived errors ignored. 0 派生错误被忽略。 [Op:__inference_train_function_12365] [操作:__inference_train_function_12365]

In the last layer of the model, use num_classes + 1:在model的最后一层,使用num_classes + 1:

outputs = Dense(num_classes + 1, activation = 'softmax')(...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM