Reputation: 31
Im getting the following error while doing CTC training:
InvalidArgumentError: 2 root error(s) found. (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 derived errors ignored. [Op:__inference_train_function_12365]
Upvotes: 1
Views: 803
Reputation: 1
In the last layer of the model, use num_classes + 1:
outputs = Dense(num_classes + 1, activation = 'softmax')(...)
Upvotes: 0