# ImportError: Using the Trainer with PyTorch: Seq2SeqTrainingArguments

**URL:** <https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599>\
**Category:** 🤗Transformers\
**Created:** [May 22, 2023, 8:47am UTC](https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599 "2023-05-22T08:47:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shirali](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Shirali](https://discuss.huggingface.co/u/Shirali)\
**Post date:** [May 22, 2023, 8:47am UTC](https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599/1 "2023-05-22T08:47:08Z")

</div>

Trying to implement Whisper fine tuning on colab: [Google Colab](https://colab.research.google.com/github/sanchit-gandhi/notebooks/blob/main/fine_tune_whisper.ipynb#scrollTo=0ae3e9af-97b7-4aa0-ae85-20b23b5bcb3a)  
When trying the step: training\_args = Seq2SeqTrainingArguments(…) got the following error message:  
ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.19.0`: Please run `pip install transformers[torch]` or `pip install accelerate -U`

I tried both `pip install transformers[torch]` or `pip install accelerate -U` with no success. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![fkov](https://avatars.discourse-cdn.com/v4/letter/f/e274bd/32.png) [@fkov](https://discuss.huggingface.co/u/fkov)\
**Post date:** [May 30, 2023, 1:19pm UTC](https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599/2 "2023-05-30T13:19:49Z")

</div>

same, did you find any solution?

---

<div class="post-metadata">

**Author:** ![Shirali](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Shirali](https://discuss.huggingface.co/u/Shirali)\
**Post date:** [May 30, 2023, 4:20pm UTC](https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599/3 "2023-05-30T16:20:57Z")

</div>

One option is “!pip install accelerate -U” at the very beginning, then restart the runtime and it should work.  
Another option may be to downgrade pytorch to 1.3.1 version.  
I hope it helps

---

<div class="post-metadata">

**Author:** ![chem1](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@chem1](https://discuss.huggingface.co/u/chem1)\
**Post date:** [June 9, 2023, 6:04am UTC](https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599/4 "2023-06-09T06:04:31Z")

</div>

Restaring the Runtime in Colab solved this issue for me

---

<div class="post-metadata">

**Author:** ![wkabbania](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wkabbania/32/16922_2.png) [@wkabbania](https://discuss.huggingface.co/u/wkabbania)\
**Post date:** [June 17, 2023, 1:23pm UTC](https://discuss.huggingface.co/t/importerror-using-the-trainer-with-pytorch-seq2seqtrainingarguments/40599/5 "2023-06-17T13:23:18Z")

</div>

> [@Shirali](#):
>
> “!pip install accelerate -U” at the very beginning, then restart the runtime and it should work.

This fixed the issue for me
