Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 3 call to "training_args = TrainingArguments("test-trainer")" returned "ImportError" despite having satisfied all the Import Requirements!! #713

Open
CodingVoyagerPrincess opened this issue Jul 15, 2024 · 0 comments

Comments

@CodingVoyagerPrincess
Copy link

CodingVoyagerPrincess commented Jul 15, 2024

All I am trying to do is call "training_args = TrainingArguments("test-trainer")" as per Chapter 3 "Fine-Tuning a model with the Trainer API" Lesson "Training".

I am having this exact same problem and I tried

  • calling pip install transformers[torch]
  • calling pip install accelerate -U
  • calling pip install datasets evaluate accelerate transformers[sentencepiece] per PaulHendi
  • calling pip install accelerate==0.21.0

(I reboot after every new attempt)
However, I continue to get the ImportError even though I have all the right dependencies installed...

ImportError: Using the Trainer with PyTorch requires accelerate>=0.21.0: Please run pip install transformers[torch] or pip install accelerate -U

This is what my virtual environment holds:
Package Version


accelerate 0.32.1
aiohttp 3.9.5
aiosignal 1.3.1
attrs 23.2.0
certifi 2024.7.4
charset-normalizer 3.3.2
colorama 0.4.6
contourpy 1.2.1
cycler 0.12.1
datasets 2.20.0
dill 0.3.8
et-xmlfile 1.1.0
evaluate 0.4.2
filelock 3.15.4
fonttools 4.53.0
frozenlist 1.4.1
fsspec 2024.5.0
huggingface-hub 0.23.4
idna 3.7
intel-openmp 2021.4.0
Jinja2 3.1.4
kiwisolver 1.4.5
MarkupSafe 2.1.5
matplotlib 3.9.0
mkl 2021.4.0
mpmath 1.3.0
multidict 6.0.5
multiprocess 0.70.16
networkx 3.3
numpy 1.26.4
openpyxl 3.1.3
packaging 24.1
pandas 2.2.2
pillow 10.3.0
pip 24.1.2
protobuf 5.27.2
psutil 6.0.0
pyarrow 16.1.0
pyarrow-hotfix 0.6
pyparsing 3.1.2
python-dateutil 2.9.0.post0
pytz 2024.1
PyYAML 6.0.1
regex 2024.5.15
requests 2.32.3
safetensors 0.4.3
seaborn 0.13.2
sentencepiece 0.2.0
six 1.16.0
sympy 1.13.0
tbb 2021.13.0
tokenizers 0.19.1
torch 2.3.1
tqdm 4.66.4
transformers 4.42.4
typing_extensions 4.12.2
tzdata 2024.1
urllib3 2.2.2
xxhash 3.4.1
yarl 1.9.4

I really do not want to have to recreate my virtual environment.
Please Help!!!

          I had the same problem. Try including accelerate in the pip install instruction in the first cell : 
!pip install datasets evaluate accelerate transformers[sentencepiece]

And restart the notebook, re-run the cells, it should be fine normally.

Originally posted by @PaulHendi in #644 (comment)

@CodingVoyagerPrincess CodingVoyagerPrincess changed the title I had the same problem. Try including accelerate in the pip install instruction in the first cell : Continuous ImportError despite having satisfied all the Import Requirements!! Jul 15, 2024
@CodingVoyagerPrincess CodingVoyagerPrincess changed the title Continuous ImportError despite having satisfied all the Import Requirements!! Chapter 3 call to training_args = TrainingArguments("test-trainer") returned "ImportError" despite having satisfied all the Import Requirements!! Jul 15, 2024
@CodingVoyagerPrincess CodingVoyagerPrincess changed the title Chapter 3 call to training_args = TrainingArguments("test-trainer") returned "ImportError" despite having satisfied all the Import Requirements!! Chapter 3 call to "training_args = TrainingArguments("test-trainer")" returned "ImportError" despite having satisfied all the Import Requirements!! Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant