ERROR with AdamW

#511
by DAARNIE - opened

image.png
22 from sklearn.preprocessing import LabelEncoder
23 from torch.utils.data import DataLoader
---> 24 from transformers import (
25 AdamW,
26 BatchEncoding,

ImportError: cannot import name 'AdamW' from 'transformers' (/usr/local/lib/python3.11/dist-packages/transformers/init.py)

AdamW optimizer has been moved in newer versions of the Hugging Face transformers library. either downgrade to transformers==3.5.1 or change this import to from torch.optim import AdamW

Thank you - this should be addressed in the current updated version.

ctheodoris changed discussion status to closed

Sign up or log in to comment