ThilinaRajapakse / pytorch-transformers-classification

Based on the Pytorch-Transformers library by HuggingFace. To be used as a starting point for employing Transformer models in text classification tasks. Contains code to easily train BERT, XLNet, RoBERTa, and XLM models for text classification.
Apache License 2.0
304 stars 97 forks source link

AttributeError: 'tuple' object has no attribute 'items' #22

Closed Magpi007 closed 4 years ago

Magpi007 commented 4 years ago

I got this error after activating the option to evaluate during training:

Untitled

I have tracked the results variable but I couldn't find the origin. Supposedly it is a dictionary type, as it has been initialized with results = {}.

ThilinaRajapakse commented 4 years ago

I pushed a fix, can you try it now? The issue was I modified the evaluation function to return both the results and the wrong predictions. The evaluate_during_training option was only expecting the results.

Magpi007 commented 4 years ago

Yeah, now looks its working. Thanks

Untitled