LLaVA-VL / LLaVA-Plus-Codebase

LLaVA-Plus: Large Language and Vision Assistants that Plug and Learn to Use Skills
https://llava-vl.github.io/llava-plus/
Apache License 2.0
698 stars 53 forks source link

ModuleNotFoundError: No module named 'demo' #23

Open Wangmmstar opened 8 months ago

Wangmmstar commented 8 months ago

Question

Hi, does anyone encounters this issue when calling the tool worker like grounding dino? $ python serve/grounding_dino_worker.py Traceback (most recent call last): File "/media/mwang34/study/mengjun/llm/LLaVA-Plus/serve/grounding_dino_worker.py", line 31, in from demo.inference_on_a_image import get_grounding_output ModuleNotFoundError: No module named 'demo'

labuladon commented 8 months ago

I met this problem also.

liwenyang-911 commented 8 months ago

Is it solved? I already solved!

pedramaghazadeh commented 8 months ago

You need to move the grounding_dino_worker.py to the same directory as GroundingDINO file you've installed. Or you can move the demo folder from GroundingDINO to the serve directory.

Wangmmstar commented 7 months ago

Hey, thank you guys. I moved those files to correct position. The old error disappears while new error jumps out when I run the chatbot on localserver. IT always shows missing scheme. SO that the answer always shows error.

Does anyone have any ideas?

File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/gradio/routes.py", line 437, in run_predict 2024-02-13 09:58:49 | ERROR | stderr | output = await app.get_blocks().process_api( 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/gradio/blocks.py", line 1352, in process_api 2024-02-13 09:58:49 | ERROR | stderr | result = await self.call_function( 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/gradio/blocks.py", line 1093, in call_function 2024-02-13 09:58:49 | ERROR | stderr | prediction = await utils.async_iteration(iterator) 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/gradio/utils.py", line 341, in async_iteration 2024-02-13 09:58:49 | ERROR | stderr | return await iterator.anext() 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/gradio/utils.py", line 334, in anext 2024-02-13 09:58:49 | ERROR | stderr | return await anyio.to_thread.run_sync( 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync 2024-02-13 09:58:49 | ERROR | stderr | return await get_async_backend().run_sync_in_worker_thread( 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread 2024-02-13 09:58:49 | ERROR | stderr | return await future 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 851, in run 2024-02-13 09:58:49 | ERROR | stderr | result = context.run(func, *args) 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/gradio/utils.py", line 317, in run_sync_iterator_async 2024-02-13 09:58:49 | ERROR | stderr | return next(iterator) 2024-02-13 09:58:49 | ERROR | stderr | File "/media/mwang34/study/mengjun/llm/LLaVA-Plus/llava/serve/gradio_web_server_llava_plus.py", line 552, in http_bot 2024-02-13 09:58:49 | ERROR | stderr | tool_response = requests.post( 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/requests/api.py", line 115, in post 2024-02-13 09:58:49 | ERROR | stderr | return request("post", url, data=data, json=json, kwargs) 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/requests/api.py", line 59, in request 2024-02-13 09:58:49 | ERROR | stderr | return session.request(method=method, url=url, kwargs) 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/requests/sessions.py", line 575, in request 2024-02-13 09:58:49 | ERROR | stderr | prep = self.prepare_request(req) 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/requests/sessions.py", line 486, in prepare_request 2024-02-13 09:58:49 | ERROR | stderr | p.prepare( 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/requests/models.py", line 368, in prepare 2024-02-13 09:58:49 | ERROR | stderr | self.prepare_url(url, params) 2024-02-13 09:58:49 | ERROR | stderr | File "/home/mwang34/anaconda3/envs/llavaplus/lib/python3.10/site-packages/requests/models.py", line 439, in prepare_url 2024-02-13 09:58:49 | ERROR | stderr | raise MissingSchema( 2024-02-13 09:58:49 | ERROR | stderr | requests.exceptions.MissingSchema: Invalid URL '/worker_generate': No scheme supplied. Perhaps you meant https:///worker_generate?

pedramaghazadeh commented 7 months ago

Make sure the ports and addresses you're specifying for each worker, controller, and model worker make sense. I also noticed that launching the model worker first and then workers might help with the inference.