Skip to content

AttributeError: 'Seq2SeqTrainingArguments' object has no attribute 'model_dir' #6

@hurricanewhk

Description

@hurricanewhk

When running python trainer_finetune.py, I encounter this error:

Traceback (most recent call last):
File "trainer_finetune.py", line 746, in
run_eval(save_dir=save_dir,
File "trainer_finetune.py", line 632, in run_eval
path_model_ext = Path(train_args.model_dir) / "pytorch_model.bin"
AttributeError: 'Seq2SeqTrainingArguments' object has no attribute 'model_dir'

I've checked the attributes of train_args, and didn't find the attribute named model_dir.
Is there something wrong? The version of my transformers is 4.28.1.

Seq2SeqTrainingArguments(
_n_gpu=4,
adafactor=False,
adam_beta1=0.9,
adam_beta2=0.999,
...
lr_scheduler_type=linear,
max_grad_norm=1.0,
max_steps=-1,
metric_for_best_model=loss,
mp_parameters=,
no_cuda=False,
num_train_epochs=5,
optim=adamw_hf,
optim_args=None,
...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions