Upgrading accelerate while using Trainer class

32 Views Asked by At

I am facing an issue whilst using Trainer class with Pytorch on Google Colab as it demands accelarate>=0.21.0 even though I have updated all the requirements, is there any alternative to it?

"Using the Trainer with PyTorch requires accelerate>=0.21.0: Please run pip install transformers[torch] or pip install accelerate -U". I have tried both the above suggestions but none worked. I don't know what am I doing wrong or how to proceed?

1

There are 1 best solutions below

0
abhiramd On

I’m getting the same error in the colab notebook for the NLP Course: Lesson 3 - Fine-tuning model with the Trainer API. In order to get around it you can:

  1. Run pip install accelerate -U in a cell
  2. In the top menu click Runtime → Restart Runtime
  3. Do not rerun any cells with !pip install in them
  4. Rerun all the other code cells and you should be good to go!

On a side note, be sure to turn on a GPU for this notebook by clicking Edit → Notebook Settings → GPU type - from the top menu. This was the next thing that got me : )

Source: https://discuss.huggingface.co/t/trainingargument-does-not-work-on-colab/43372/6