-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
ImportError:Using the Trainer
with PyTorch
requires accelerate>=0.20.1
:Please run pip install transformers[torch]
orpip install accelerate -U
#29174
ImportError:Using the Trainer
with PyTorch
requires accelerate>=0.20.1
:Please run pip install transformers[torch]
orpip install accelerate -U
#29174
Comments
Hi @smyousaf1, have you tried upgrading the installed version of accelerate in your environment as indicated by the error message? |
I'm facing the same error on the colab example (with the pytorch implementation): https://huggingface.co/docs/transformers/tasks/sequence_classification . The pip command for accelerate is missing, but after including it and installing accelerate, the error keeps showing up, not sure why. Seems like the tutorial could be outdated? I'm my local computer I managed to make it work. |
@aghie Are you refreshing the notebook session? If you're updating |
Thanks @amyeroberts! I was trying that initially but kept getting the error, but it did work after I made a separate copy of the notebook. Do you think it would be possible to update the tutorial? In its current form, it appears odd to run a pip command to install transformers and datasets, only to later find that modifying the notebook to include a second pip command for installing accelerate (and evaluate) is necessary. This only happen in the pytorch version. |
Sure! Would you like to open a PR to update to include installing accelerate and evaluate? This way you get the github contribution. |
Hi, I've replicated this issue in both of the notebooks mentioned above and I'd like to take on this issue :) |
@MariaHei Great! In general, we prioritize based on PRs open, rather than comments on issues. If there's an issue without an open and active PR open, you're free to start work on it :) We find this prevents issues from becoming stale. |
Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface/transformers#29174
Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface/transformers#29174
Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface#29174
Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface#29174
Trainer with PyTorch now requires accelerate to be installed. Partly resolves #29174
Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface/transformers#29174
* Update installs in pytorch text+image classification notebooks Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface/transformers#29174 * medusa (#485) * Update installs in pytorch text+image classification notebooks Trainer with PyTorch now requires accelerate to be installed. Partly resolves huggingface/transformers#29174 * improve language in image_classification notebook * remove changes to sagemaker NB --------- Co-authored-by: Philipp Schmid <32632186+philschmid@users.noreply.github.com>
….20.1 Fix (#29888) * ImportError: Trainer with PyTorch requires accelerate>=0.20.1 Fix Adding the evaluate and accelerate installs at the beginning of the cell to fix the issue * ImportError Fix: Trainer with PyTorch requires accelerate>=0.20.1 * Import Error Fix * Update installation.md * Update quicktour.md * rollback other lang changes * Update _config.py * updates for other languages * fixing error * Tutorial Update * Update tokenization_utils_base.py * Just use an optimizer string to pass the doctest? --------- Co-authored-by: Matt <rocketknight1@gmail.com>
….20.1 Fix (#29888) * ImportError: Trainer with PyTorch requires accelerate>=0.20.1 Fix Adding the evaluate and accelerate installs at the beginning of the cell to fix the issue * ImportError Fix: Trainer with PyTorch requires accelerate>=0.20.1 * Import Error Fix * Update installation.md * Update quicktour.md * rollback other lang changes * Update _config.py * updates for other languages * fixing error * Tutorial Update * Update tokenization_utils_base.py * Just use an optimizer string to pass the doctest? --------- Co-authored-by: Matt <rocketknight1@gmail.com>
Trainer with PyTorch now requires accelerate to be installed. Partly resolves #29174
….20.1 Fix (#29888) * ImportError: Trainer with PyTorch requires accelerate>=0.20.1 Fix Adding the evaluate and accelerate installs at the beginning of the cell to fix the issue * ImportError Fix: Trainer with PyTorch requires accelerate>=0.20.1 * Import Error Fix * Update installation.md * Update quicktour.md * rollback other lang changes * Update _config.py * updates for other languages * fixing error * Tutorial Update * Update tokenization_utils_base.py * Just use an optimizer string to pass the doctest? --------- Co-authored-by: Matt <rocketknight1@gmail.com>
System Info
transformers_version -> (4.35.2)
Environment -> Google Colab
Who can help?
smyousaf1
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
ImportError Traceback (most recent call last)
in <cell line: 1>()
----> 1 training_args = TrainingArguments(
2 output_dir="my_awesome_food_model",
3 remove_unused_columns=False,
4 evaluation_strategy="epoch",
5 save_strategy="epoch",
4 frames
/usr/local/lib/python3.10/dist-packages/transformers/training_args.py in _setup_devices(self)
1785 if not is_sagemaker_mp_enabled():
1786 if not is_accelerate_available(min_version="0.20.1"):
-> 1787 raise ImportError(
1788 "Using the
Trainer
withPyTorch
requiresaccelerate>=0.20.1
: Please runpip install transformers[torch]
orpip install accelerate -U
"1789 )
ImportError: Using the
Trainer
withPyTorch
requiresaccelerate>=0.20.1
: Please runpip install transformers[torch]
orpip install accelerate -U
Expected behavior
I expected it to Train but it produced an error in training segment.
The text was updated successfully, but these errors were encountered: