I’m training a model with transformers Trainer but when I set the number of epoch to eg: 1000 then it seems the training just does 1000 steps however an epoch is normally the number of times the model goes through the entire dataset. Thus, how can we use the trainer such that each epoch goes through the full training dataset (and that we see the progression of these)
Please post the command/code you are executing as we can’t really help without that.
Sure, sorry! I thought it was not a code specific question but rather about the parameters of the Trainer class
Here is the code I use:
from transformers import Trainer, TrainingArguments
training_args = TrainingArguments(
trainer = Trainer(
I would expect that there are 1000 epoch that goes through the full train_dataset but the output goes very fast and prints “epoch 1/1000, epoch 2/1000, epoch 3/1000, …” which give the impression that the epoch is simply a training step rather than an actual epoch. However, having 20k training instances I expect to see 20k steps for each epoch and this normally take some time.
I wanted to check your
num_train_epochs wasn’t overridden by other parameters like
max_steps. The code looks correct and the logs do indicate you are going through the epochs. Double check the length of your dataset to make sure it’s not reduced to something small.
My dataset seem to have the right size. Using Wandb logger it seems that there is only 1 step performed in each epoch indeed… I don’t know what could be wrong.
My code is basically done as in this post.