config.json is missing 2 labels from id2label and label2id: 9205 and 15027

#5
by cristian-m-vasile - opened

There are two labels missing from config.json's id2label key: 9205 and 15027. This causes issues in one's script when running the code in 'How to use':

predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])

The keys are simply skipped in id2label (please see the photos attached), they are the only ones skipped in id2label (proof in photos), and they don't exist in label2id either (I checked).

I was simply playing around with the model when I got an error using your code and I noticed this. I can tell that the labels are missing because the model still predicts those keys, even though they're not in the config file.

This version is probably too old to get an update, but I'm leaving it here for anyone like me who's still using it.

image.png

image.png

image.png

cristian-m-vasile changed discussion title from config.json is missing 2 labels from id2label and label2id to config.json is missing 2 labels from id2label and label2id: 9205 and 15027

Sign up or log in to comment