ValueError: too many values to unpack (expected 2) when using eval_df
See original GitHub issueHello, I create the model with this code:
model = ClassificationModel( "bert", "dbmdz/bert-base-turkish-uncased",use_cuda=cuda_available,num_labels=num_labels,args={'reprocess_input_data': True, 'overwrite_output_dir': True , 'num_train_epochs': 2,"evaluate_during_training":True, "evaluate_each_epoch":True,"save_best_model":True, "save_model_every_epoch":True,"best_model_dir":"best_bert/"} )
then I call train_model function like this:
model.train_model(train_df,eval_df=eval_df)
but after first epoch it return to me too many values to unpack (expected 2) error on here `ValueError Traceback (most recent call last) <ipython-input-28-ab826287928d> in <module> ----> 1 model.train_model(train_df,eval_df=eval_df)
~/.conda/envs/sentiment/lib/python3.6/site-packages/simpletransformers/classification/classification_model.py in train_model(self, train_df, multi_label, output_dir, show_running_loss, args, eval_df, verbose, **kwargs) 610 eval_df=eval_df, 611 verbose=verbose, –> 612 **kwargs, 613 ) 614
~/.conda/envs/sentiment/lib/python3.6/site-packages/simpletransformers/classification/classification_model.py in train(self, train_dataloader, output_dir, multi_label, show_running_loss, eval_df, test_df, verbose, **kwargs) 1180 1181 for key, value in flatten_results( -> 1182 self._get_last_metrics(training_progress_scores) 1183 ): 1184 try:
ValueError: too many values to unpack (expected 2) `
How can I solve this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
In fact elsewhere in the code the .items() is present for example: https://github.com/ThilinaRajapakse/simpletransformers/blob/8859e3a9e30900f1575509c7a7a6eb3ddece6cef/simpletransformers/ner/ner_model.py#L1031-L1041 so this seems like a quick fix. It seems like the bug was introduced in pull request #1209
This should be fixed now in the latest version (
0.62.4
)