I’m going through the Huggingface tutorial. In this section, I met a problem with this code:
from transformers import TrainingArguments
training_args = TrainingArguments("test-trainer")
Where I’m getting the error:
ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.21.0`: Please run `pip install transformers[torch]` or `pip install accelerate -U`
I tried !pip install accelerate==0.30.0
. The installation worked fine, but I’m still getting the same error. I then tried:
from transformers import TrainingArguments
import importlib
import accelerate
importlib.reload(accelerate)
print(accelerate.__version__)
training_args = TrainingArguments("test-trainer")
It shows that accelerate’s version is indeed 0.30.0 but I’m still getting the error that needs it to be above 0.21.0.
BTW, when I tried to deal with this on my own computer, restarting the jupyter kernel seems to solve it. But I cannot restart since I’m now on colab.
Any thoughts on this?
Weiqi ZHANG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.