haotian-liu / LLaVA

[NeurIPS'23 Oral] Visual Instruction Tuning (LLaVA) built towards GPT-4V level capabilities and beyond.
https://llava.hliu.cc
Apache License 2.0
19.26k stars 2.11k forks source link

Cant start controller for LLaVa "llava' is already used by a Transformers config, pick another name" #974

Open benik923 opened 8 months ago

benik923 commented 8 months ago

Describe the issue

Issue: Controller/Webserver wont start

ive tried everything chatgpt and bard suggested, no results. -pip uninstalling reinstalling llava (wich is just a part of it i guess since it took mere seconds) -pip install transformers --upgrade -renamed the whole thing which lead to other errors with wrongly named files

i am also very new to all of this so sorry if this is really stupid. thank you, -benik

Command:

python -m llava.serve.controller --host 0.0.0.0 --port 10000

Log:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\Niklas\llava\llava\__init__.py", line 1, in <module>
    from .model import LlavaLlamaForCausalLM
  File "C:\Users\Niklas\llava\llava\model\__init__.py", line 1, in <module>
    from .language_model.llava_llama import LlavaLlamaForCausalLM, LlavaConfig
  File "C:\Users\Niklas\llava\llava\model\language_model\llava_llama.py", line 110, in <module>
    AutoConfig.register("llava", LlavaConfig)
  File "C:\Users\Niklas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\transformers\models\auto\configuration_auto.py", line 1128, in register
    CONFIG_MAPPING.register(model_type, config, exist_ok=exist_ok)
  File "C:\Users\Niklas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\transformers\models\auto\configuration_auto.py", line 828, in register
    raise ValueError(f"'{key}' is already used by a Transformers config, pick another name.")
ValueError: 'llava' is already used by a Transformers config, pick another name.
koking0 commented 8 months ago

me too

benik923 commented 8 months ago

me too

im not quite sure but i think running this fixed it for me: git pull pip install -e .

henningb-cf commented 7 months ago

What version of transformers are you using? In the latest version, the LLaVA already exists so you could (1) install the version specified in this repo or (2) change the name for registering the config.

aymenabid-lab commented 7 months ago

explain more

henningb-cf commented 7 months ago

This line:

File "C:\Users\Niklas\llava\llava\model\language_model\llava_llama.py", line 110, in <module>
    AutoConfig.register("llava", LlavaConfig)

File "C:\Users\Niklas\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\transformers\models\auto\configuration_auto.py", line 828, in register
    raise ValueError(f"'{key}' is already used by a Transformers config, pick another name.")
ValueError: 'llava' is already used by a Transformers config, pick another name.

tells you that you cannot register a config with the name 'llava' bc it's already used. This is the case when using transformers > 4.35 (I think where HF added LLaVA). So check version of transformers which shoulde be 4.31.. OR you can check the line where you register to AutoConfig.register("llava_org", LlavaConfig) or something. Best to install the right dependencies though to avoid other conflicts.

CateMrl commented 7 months ago

@HB-ai-cf can you explain more in detail how to do that?

haotian-liu commented 7 months ago

The latest code base shall have this fixed. Thanks.

aymenabid-lab commented 6 months ago

Transformer version is 4.37.1 How to fix (check the line where you register to AutoConfig.register("llava_org", LlavaConfig or other solution) No good issue to install the 4.3.1

have another idea

KatameRonin commented 5 months ago

It is most likely because the transformer version is incompatible. Try the following: pip list This will list your packages in your environment. Then use: pip uninstall transformers And then finally: pip install transformers==4.31.0

Essentially the version shown for transformers in cog.yaml file in the llava repository. This worked for me

starforce commented 2 months ago

for me it was:

I am debugging llava locally on my computer and did a pip install -e . to a local folder then few weeks later , I did a pip install on another version of transformer. So, causes a conflict. so do another pip install -e . where the LLava folder is and the problem will go away.

garychan22 commented 1 month ago

my solution is change the model_type param in the customized model config before calling any "xxx.register(...)", then the conflict disappears