Closed tangzhy closed 3 years ago
transformers
@sgugger @jplu @stefan-it
Model I am using (Bert, XLNet ...): Bert
The problem arises when using: [ ] the official example scripts: (give details below) [x] my own modified scripts: (give details below)
The tasks I am working on is: [ ] an official GLUE/SQUaD task: (give the name) [x] my own task or dataset: (give details below)
Steps to reproduce the behavior:
evaluation_strategy
evaluate_strategy
training_args = TFTrainingArguments( output_dir="/root/Data/marco-passage-ranking/results", overwrite_output_dir=True, do_train=True, do_eval=True, do_predict=False, evaluation_strategy="no", eval_steps=1000, per_device_train_batch_size=8, # batch size per device during training per_device_eval_batch_size=8, # batch size for evaluation learning_rate=1e-6, max_steps=400000, warmup_steps=40000, logging_dir="./tmp/log", logging_steps=1000, save_steps=1000, fp16=False, # eval_steps=1000, xla =False ) trainer = TFTrainer( model=model, args=training_args, train_dataset=train_ds.take(100000), eval_dataset=dev_ds.take(10000), compute_metrics=compute_metrics, ) trainer.train() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-19-25eb465360cc> in <module> 7 ) 8 ----> 9 trainer.train() ~/Softwares/anaconda3/envs/tf2.0/lib/python3.7/site-packages/transformers/trainer_tf.py in train(self) 562 if ( 563 self.args.eval_steps > 0 --> 564 and self.args.evaluate_strategy == EvaluationStrategy.STEPS 565 and self.global_step % self.args.eval_steps == 0 566 ): AttributeError: 'TFTrainingArguments' object has no attribute 'evaluate_strategy'
I think this might be a bug where the inconsistency of eval_strategy name raises Exception. Any advice?
Oh this is a typo, do you want to open a PR to fix it?
Environment info
transformers
version: 4.0.1@sgugger @jplu @stefan-it
Information
Model I am using (Bert, XLNet ...): Bert
The problem arises when using: [ ] the official example scripts: (give details below) [x] my own modified scripts: (give details below)
The tasks I am working on is: [ ] an official GLUE/SQUaD task: (give the name) [x] my own task or dataset: (give details below)
To reproduce
Steps to reproduce the behavior:
evaluation_strategy
in training_args becomesevaluate_strategy
I think this might be a bug where the inconsistency of eval_strategy name raises Exception. Any advice?