On colab, error with ‘Trainer’ object has no attribute ‘do_grad_scaling’. Why no such error on official jupyter lab server?
Hi @SBFALLOUT,
This can be because one of the packages used for this notebook has a different version on the platform and, possibly the latest, version on in the colab environment. The author might have moved around the things a little bit which is why you are getting this error.
In order to avoid such inconveniences in running things in a colab or locally, please make sure you are using exact package versions as they are being used in the platform.
Best,
Mubsi
I have the same problem despite working on jupyter notebook.In the utilities.py file there is no “do_grad_scaling” attribute. how can I get the latest version of file?
Thanks,
Volkan
Hi @Volkan_Celik,
Please take note of this comment.
How does one find the package versions ?
!pip list doesn’t work
Try !pip install transformers==4.32.1
This works for me, I hope this will work for you as well.
Thank you!It works for me too
The stack trace indicates that the error is in utilities.py file, near line 276
I have replaced this
if self.do_grad_scaling:
self.scaler.scale(loss).backward()
else:
self.accelerator.backward(loss)
with this
#if self.do_grad_scaling:
# self.scaler.scale(loss).backward()
#else:
self.accelerator.backward(loss)
Any body can share the exact packages to install to avoid any error.
and the exact utilities.py file
# python 3.9.
datasets==2.14.4
transformers[torch]==4.31.0
tokenizers==0.13.3
#python-configuration[yaml]
python-configuration
torch==2.0.1
scipy==1.11.1
zstandard==0.21.0
accelerate==0.21.0
numpy==1.24.3
urllib3==1.26.0
ipywidgets==8.0.7
#lamini==0.0.20
lamini==2.0.1
-e ./L6/lm-evaluation-harness/.
# ran this in the L6 directory where it is used
#!git clone https://github.com/EleutherAI/lm-evaluation-harness
#!pip install -e lm-evaluation-harness/.