lxtGH / OMG-Seg

OMG-LLaVA and OMG-Seg codebase [CVPR-24 and NeurIPS-24]
Other
1.27k stars 48 forks source link

error when running the omg-llava demo #51

Closed abcjhby2871 closed 1 month ago

abcjhby2871 commented 1 month ago

I use the following instructions to create the env,

conda create -n omg-llava python=3.10 -y
conda activate omg-llava
conda install pytorch torchvision torchaudio pytorch-cuda==12.1 -c pytorch -c nvidia
python -m pip install https://github.com/open-mmlab/mmengine/archive/refs/tags/v0.8.5.zip
TORCH_CUDA_ARCH_LIST="8.0" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" CUDA_HOME=$(dirname $(dirname $(which nvcc))) LD_LIBRARY_PATH=$(dirname $(dirname $(which nvcc)))/lib MMCV_WITH_OPS=1 FORCE_CUDA=1 python -m pip install git+https://github.com/open-mmlab/mmcv.git@4f65f91db6502d990ce2ee5de0337441fb69dd10
python -m pip install \
https://github.com/open-mmlab/mmdetection/archive/refs/tags/v3.1.0.zip \
https://github.com/open-mmlab/mmsegmentation/archive/refs/tags/v1.1.1.zip \
https://github.com/open-mmlab/mmpretrain/archive/refs/tags/v1.0.1.zip
python -m pip install git+https://github.com/cocodataset/panopticapi.git \
git+https://github.com/HarborYuan/lvis-api.git \
tqdm terminaltables pycocotools scipy tqdm ftfy regex timm scikit-image kornia
pip install -e '.[all]'

however,when running the command python omg_llava/tools/app.py omg_llava/configs/finetune/omg_llava_7b_finetune_8gpus.py ./pretrained/omg_llava/omg_llava_7b_finetune_8gpus.pth
an error occurs,which seems to be a type error caused by the network modules. Wish you can help me with it!

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
    self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
    raise AttributeError(attribute)
AttributeError: __pydantic_core_schema__
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/gradio/route_utils.py", line 720, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/gradio/route_utils.py", line 736, in simple_response
    await self.app(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/routing.py", line 291, in app
    solved_result = await solve_dependencies(
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 656, in solve_dependencies
    ) = await request_body_to_args(  # body_params checked above
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 881, in request_body_to_args
    fields_to_extract = get_cached_model_fields(first_field.type_)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
    return get_model_fields(model)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/_compat.py", line 284, in get_model_fields
    return [
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/_compat.py", line 285, in <listcomp>
    ModelField(field_info=field_info, name=name)
  File "<string>", line 6, in __init__
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/fastapi/_compat.py", line 110, in __post_init__
    self._type_adapter: TypeAdapter[Any] = TypeAdapter(
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/type_adapter.py", line 257, in __init__
    self._init_core_attrs(rebuild_mocks=False)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/type_adapter.py", line 135, in wrapped
    return func(self, *args, **kwargs)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
    self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
    schema = gen.generate_schema(type_)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
    return self._annotated_schema(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
    schema = self._apply_annotations(source_type, annotations)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
    schema = get_inner_schema(source_type)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
    schema = self._handler(source_type)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
    schema = metadata_get_schema(source, get_inner_schema)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in <lambda>
    lambda source, handler: handler(source)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
    schema = self._handler(source_type)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
    schema = self._generate_schema_inner(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
    return self._match_generic_type(obj, origin)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
    return self._union_schema(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
    choices.append(self.generate_schema(arg))
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
    return self._unknown_type_schema(obj)
  File "/data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
    raise PydanticSchemaGenerationError(
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.

For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type

Could not create share link. Missing file: /data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2. 

Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps: 

1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64
2. Rename the downloaded file to: frpc_linux_amd64_v0.2
3. Move the file to this location: /data1/student/xxx/anaconda3/envs/omg-llava/lib/python3.10/site-packages/gradio
abcjhby2871 commented 1 month ago

Additionally, even when I have installed the missing file, the problem still exists.

Zara7hus7ra commented 1 week ago

same error, did you solve this problem? @abcjhby2871