unslothai / unsloth

Finetune Llama 3.2, Mistral, Phi, Qwen & Gemma LLMs 2-5x faster with 80% less memory
https://unsloth.ai
Apache License 2.0
17.85k stars 1.24k forks source link

RuntimeError: Failed to import transformers.data.data_collator because of the following error (look up to see its traceback): maximum recursion depth exceeded #1022

Open karacupa21 opened 1 month ago

karacupa21 commented 1 month ago

Traceback (most recent call last): File "/home/ma-user/work/run_train_unsloth_config.py", line 20, in from unsloth import FastLanguageModel File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/init.py", line 157, in from .models import File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/models/init.py", line 15, in from .loader import FastLanguageModel File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/models/loader.py", line 16, in from .llama import FastLlamaModel, logger File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/models/llama.py", line 32, in from ..tokenizer_utils import File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/tokenizer_utils.py", line 1109, in import trl.trainer.sft_trainer File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/trl/trainer/sft_trainer.py", line 28, in from transformers import ( File "", line 1229, in _handle_fromlist File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1593, in getattr module = self._get_module(self._class_to_module[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1605, in _get_module raise RuntimeError( RuntimeError: Failed to import transformers.data.data_collator because of the following error (look up to see its traceback): maximum recursion depth exceeded

karacupa21 commented 1 month ago

File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/numpy/core/numerictypes.py", line 417, in issubdtype arg1 = dtype(arg1).type ^^^^^^^^^^^ File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/numpy/core/_dtype.py", line 46, in repr arg_str = _construction_repr(dtype, include_align=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/numpy/core/_dtype.py", line 100, in _construction_repr return _scalar_str(dtype, short=short) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/numpy/core/_dtype.py", line 143, in _scalar_str elif np.issubdtype(dtype, np.number): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ma-user/anaconda3/envs/unsloth_env/lib/python3.11/site-packages/numpy/core/numerictypes.py", line 417, in issubdtype arg1 = dtype(arg1).type ^^^^^^^^^^^

danielhanchen commented 1 month ago

Oh that's not good - maybe try reinstalling / upgrading numpy