AttributeError: 'TrainOutput' object has no attribute 'metrics' when finetune custom dataset
Hi,I’m try to finetune Bert on sst2 dataset by using run_glue.py (https://github.com/huggingface/transformers/blob/master/examples/text-classification/run_glue.py).I randomly pick 1% train data and 10 validation data from sst2 original dataset, and build them as csv. file with label and sentence columns.Here is my finetune setting:But there is an error occurred:Traceback (most recent call last):File “run_glue.py”, line 432, inmain()File “run_glue.py”, line 356, in mainmetrics = train_result.metricsAttributeError: ‘TrainOutput’ object has no attribute ‘metrics’I run all these scripts on colab pro
2020-12-29T06:50:32Z
HiCould you post yourtransformersversion. Also to run the examples you should install transformers from source.
2020-12-29T11:08:02Z
Thanks for your reply!!My transformers is the newest version 4.1.1.And I think I figure out why the error occured, because my label column index is 0 and sentence column is 1, the default setting is that the label column index should be 1 and sentence column index should be 0.
2021-01-04T13:04:44Z
The newest version can not be enough, you need a source install. In this case, the metrics have been added to theTrainiOutputvery recently.