ValueError: Transformers does not recognize this architecture.

#15
by mike202303 - opened

ValueError: The checkpoint you are trying to load has model type gemma2 but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

OS:Ubuntu22.04
nvcc:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:49:14_PDT_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0
NVIDIA-smi:

图片.png

I try update the Transformers
pip install --upgrade transformers
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: transformers in /root/miniconda3/lib/python3.11/site-packages (4.41.2)
Collecting transformers
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/20/5c/244db59e074e80248fdfa60495eeee257e4d97c3df3487df68be30cd60c8/transformers-4.42.3-py3-none-any.whl (9.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.3/9.3 MB 12.7 MB/s eta 0:00:00
Requirement already satisfied: filelock in /root/miniconda3/lib/python3.11/site-packages (from transformers) (3.13.1)
Requirement already satisfied: huggingface-hub<1.0,>=0.23.2 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (0.23.4)
Requirement already satisfied: numpy<2.0,>=1.17 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (1.26.4)
Requirement already satisfied: packaging>=20.0 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (23.0)
Requirement already satisfied: pyyaml>=5.1 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (6.0.1)
Requirement already satisfied: regex!=2019.12.17 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (2024.5.15)
Requirement already satisfied: requests in /root/miniconda3/lib/python3.11/site-packages (from transformers) (2.32.3)
Requirement already satisfied: safetensors>=0.4.1 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (0.4.3)
Requirement already satisfied: tokenizers<0.20,>=0.19 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (0.19.1)
Requirement already satisfied: tqdm>=4.27 in /root/miniconda3/lib/python3.11/site-packages (from transformers) (4.65.0)
Requirement already satisfied: fsspec>=2023.5.0 in /root/miniconda3/lib/python3.11/site-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (2024.2.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /root/miniconda3/lib/python3.11/site-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (4.12.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /root/miniconda3/lib/python3.11/site-packages (from requests->transformers) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /root/miniconda3/lib/python3.11/site-packages (from requests->transformers) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /root/miniconda3/lib/python3.11/site-packages (from requests->transformers) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in /root/miniconda3/lib/python3.11/site-packages (from requests->transformers) (2023.5.7)
Installing collected packages: transformers
Attempting uninstall: transformers
Found existing installation: transformers 4.41.2
Uninstalling transformers-4.41.2:
Successfully uninstalled transformers-4.41.2
Successfully installed transformers-4.42.3

But: The Error again!!

So ,How fixed it~~

same problem

Google org

Hello! This shouldn't happen and is likely a problem in your environment.

Within your environment, what happens if you do

python

>>> from transformers import __version__
>>> print(__version__)

?

Google org
edited Jul 1

Hi @mike202303 and @carloscaminha , Could you please try again by installing this specific version of transformers 4.42.0 or 4.42.1 as mentioned in this similar issue and let us know if the issue still persists, Thank you.

Google org

Thanks @Renu11 ! An even better version would be v4.42.3 as that's the version in which we added support for the soft-capping of logits.

It worked with v4.42.3. Thanks!

Sign up or log in to comment