# Problem with Classlabel : Class label -100 greater than configured num\_classes 18

**URL:** <https://discuss.huggingface.co/t/problem-with-classlabel-class-label-100-greater-than-configured-num-classes-18/19288>\
**Category:** 🤗Datasets\
**Created:** [June 17, 2022, 1:22pm UTC](https://discuss.huggingface.co/t/problem-with-classlabel-class-label-100-greater-than-configured-num-classes-18/19288 "2022-06-17T13:22:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Misterpy](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@Misterpy](https://discuss.huggingface.co/u/Misterpy)\
**Post date:** [June 17, 2022, 1:22pm UTC](https://discuss.huggingface.co/t/problem-with-classlabel-class-label-100-greater-than-configured-num-classes-18/19288/1 "2022-06-17T13:22:31Z")

</div>

Hello to all,  
I work on the extraction of information on documents, I use the model LayoutLMV2 that I finetune on my data. To optimize the training I use the Trainer. So I used this example to prepare the data. But I have a problem, after processing the data with the LayoutLMV2 processor, some special tokens will have a value of -100 which is normal. But when I try to transform these data into datasets knowing that I have specified the features I have an error related to the value -100, I think that the Classlabel automatically deducts the indexes of the classes, so if I specify that I have 18 classes and it finds the value -100 it raises an error, if I replace the datasets type. Classlabel(names = labels) by datasets.Value(dtype=‘int64’), it’s going to work but I wonder if it’s the best way to do it and then I find this error weird, because before it worked, besides the example I used doesn’t work anymore (same error) so I wonder if it’s related to the datasets version.  
the example I used :[Google Colab](https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv2/FUNSD/Fine_tuning_LayoutLMv2ForTokenClassification_on_FUNSD_using_HuggingFace_Trainer.ipynb#scrollTo=oYlbGDFg_wkh)  
my code :

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/c/ceb4cc8a1c3885cc6d66732b2c97a700890817b1.png)

Thank you in advance for your help 🙂

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [June 19, 2022, 6:59pm UTC](https://discuss.huggingface.co/t/problem-with-classlabel-class-label-100-greater-than-configured-num-classes-18/19288/2 "2022-06-19T18:59:34Z")

</div>

Hi,

Thanks for reporting. It’s a mistake on my side, the ‘labels’ are actually of type `datasets.Sequence(feature=datasets.Value(dtype='int64'))`, rather than `ClassLabel`.
