krishnaik06 / Huggingfacetransformer

GNU General Public License v3.0
59 stars 97 forks source link

TypeError: Expected bool passed to parameter 'y' of op 'NotEqual', got -100 of type 'int' instead. Error: Expected bool, but got -100 of type 'int'. #6

Open ZhyKazer opened 1 month ago

ZhyKazer commented 1 month ago

TypeError: in user code:

File "H:\NLP_Training\NLP_3.8\lib\site-packages\transformers\trainer_tf.py", line 701, in distributed_training_steps  *
    nb_instances_in_batch = self._compute_nb_instances(batch)
File "H:\NLP_Training\NLP_3.8\lib\site-packages\transformers\trainer_tf.py", line 713, in _compute_nb_instances  *
    nb_instances = tf.reduce_sum(tf.cast(labels != -100, dtype=tf.int32))

TypeError: Expected bool passed to parameter 'y' of op 'NotEqual', got -100 of type 'int' instead. Error: Expected bool, but got -100 of type 'int'.