6

I am trying to train a T5 model based on spellcheck by providing it with a sample csv file in google colab. Initially I ran the code with my personal device (python locally installed) and it executed without any errors but after switching to a different device (no python setup) it gives me an error.

training_args = TrainingArguments(
    output_dir="./spellcheck_model",
    per_device_train_batch_size=16,
    num_train_epochs=3,
    logging_steps=100,
    save_steps=500,
    save_total_limit=2,
    evaluation_strategy="steps",
    eval_steps=500,
    learning_rate=5e-5,
    report_to="none"
)

Here is my training code and the error which I'm receiving is:

TypeError                                 Traceback (most recent call last)
<ipython-input-8-f33950e92b43> in <cell line: 0>()
     67 
     68 # 4. Training settings
---> 69 training_args = TrainingArguments(
     70     output_dir="./spellcheck_model",
     71     per_device_train_batch_size=16,

TypeError: TrainingArguments.__init__() got an unexpected keyword argument 'evaluation_strategy

To check the issue I have run the command below and it does seems okay for me to continue and that the code should run

import transformers
print(transformers.__version__)
print(transformers.__file__)

The output is 4.51.3 /usr/local/lib/python3.11/dist-packages/transformers/__init__.py

How to fix this ?

2
  • 3
    I think you made a minor typo in that. According to huggingface.co/docs/transformers/v4.51.3/en/main_classes/…, it should be eval_strategy and not evaluation_strategy. Commented Apr 15, 2025 at 4:36
  • 1
    Ohh Man! Just saw it :) Thank you so much for pointing it out !! Commented Apr 15, 2025 at 4:42

3 Answers 3

16

Yeah, I was facing the same issue too. But it got resolved after I changed the keyword from "evalution_strategy" to "eval_strategy".

Sign up to request clarification or add additional context in comments.

Comments

6

It worked by changing to eval_strategy

Comments

0

the evaluation_strategy keyword argument in TrainingArguments has now been replaced with eval_strategy. Using the old argument causes:

TrainingArguments.__init__() got an unexpected keyword argument 'evaluation_strategy'

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.