[BUG] MACHINE_LEARNING_CLIP_TEXT_MODEL no longer supported ? #1013

Closed
opened 2026-02-04 23:58:12 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @martabal on GitHub (Jun 27, 2023).

The bug

I have set MACHINE_LEARNING_CLIP_TEXT_MODEL environment variable to clip-ViT-B-32-multilingual-v1 for my Clip Text Model for months and it was working well. However in v1.64.0, I get this error :

immich_machine_learning  | Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration.
immich_machine_learning  | ERROR:    Traceback (most recent call last):
immich_machine_learning  |   File "/opt/venv/lib/python3.11/site-packages/starlette/routing.py", line 677, in lifespan
immich_machine_learning  |     async with self.lifespan_context(app) as maybe_state:
immich_machine_learning  |   File "/opt/venv/lib/python3.11/site-packages/starlette/routing.py", line 566, in __aenter__
immich_machine_learning  |     await self._router.startup()
immich_machine_learning  |   File "/opt/venv/lib/python3.11/site-packages/starlette/routing.py", line 654, in startup
immich_machine_learning  |     await handler()
immich_machine_learning  |   File "/usr/src/app/main.py", line 43, in startup_event
immich_machine_learning  |     await app.state.model_cache.get(model_name, model_type)
immich_machine_learning  |   File "/usr/src/app/models/cache.py", line 57, in get
immich_machine_learning  |     model = await asyncio.get_running_loop().run_in_executor(
immich_machine_learning  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
immich_machine_learning  |   File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
immich_machine_learning  |     result = self.fn(*self.args, **self.kwargs)
immich_machine_learning  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
immich_machine_learning  |   File "/usr/src/app/models/cache.py", line 59, in <lambda>
immich_machine_learning  |     lambda: InferenceModel.from_model_type(
immich_machine_learning  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
immich_machine_learning  |   File "/usr/src/app/models/base.py", line 50, in from_model_type
immich_machine_learning  |     raise ValueError(f"Unsupported model type: {model_type}")
immich_machine_learning  | ValueError: Unsupported model type: ModelType.CLIP_VISION
immich_machine_learning  | 
immich_machine_learning  | ERROR:    Application startup failed. Exiting.

Tested with AIO image and official machine-learning docker (the error is from the official docker)

The OS that Immich Server is running on

Unraid

Version of Immich Server

v1.64.0

Version of Immich Mobile App

Not relevant

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Not relevant

Your .env content

Not relevant (just add MACHINE_LEARNING_CLIP_TEXT_MODEL=clip-ViT-B-32-multilingual-v1 to it)

Reproduction steps

1. Add MACHINE_LEARNING_CLIP_TEXT_MODEL=clip-ViT-B-32-multilingual-v1 to your .env file
2. Start your machine-learning docker
3. It crashes with code 0

Additional information

No response

Originally created by @martabal on GitHub (Jun 27, 2023). ### The bug I have set `MACHINE_LEARNING_CLIP_TEXT_MODEL` environment variable to `clip-ViT-B-32-multilingual-v1` for my Clip Text Model for months and it was working well. However in v1.64.0, I get this error : ```bash immich_machine_learning | Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration. immich_machine_learning | ERROR: Traceback (most recent call last): immich_machine_learning | File "/opt/venv/lib/python3.11/site-packages/starlette/routing.py", line 677, in lifespan immich_machine_learning | async with self.lifespan_context(app) as maybe_state: immich_machine_learning | File "/opt/venv/lib/python3.11/site-packages/starlette/routing.py", line 566, in __aenter__ immich_machine_learning | await self._router.startup() immich_machine_learning | File "/opt/venv/lib/python3.11/site-packages/starlette/routing.py", line 654, in startup immich_machine_learning | await handler() immich_machine_learning | File "/usr/src/app/main.py", line 43, in startup_event immich_machine_learning | await app.state.model_cache.get(model_name, model_type) immich_machine_learning | File "/usr/src/app/models/cache.py", line 57, in get immich_machine_learning | model = await asyncio.get_running_loop().run_in_executor( immich_machine_learning | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ immich_machine_learning | File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run immich_machine_learning | result = self.fn(*self.args, **self.kwargs) immich_machine_learning | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ immich_machine_learning | File "/usr/src/app/models/cache.py", line 59, in <lambda> immich_machine_learning | lambda: InferenceModel.from_model_type( immich_machine_learning | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ immich_machine_learning | File "/usr/src/app/models/base.py", line 50, in from_model_type immich_machine_learning | raise ValueError(f"Unsupported model type: {model_type}") immich_machine_learning | ValueError: Unsupported model type: ModelType.CLIP_VISION immich_machine_learning | immich_machine_learning | ERROR: Application startup failed. Exiting. ``` Tested with AIO image and official machine-learning docker (the error is from the official docker) ### The OS that Immich Server is running on Unraid ### Version of Immich Server v1.64.0 ### Version of Immich Mobile App Not relevant ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML Not relevant ``` ### Your .env content ```Shell Not relevant (just add MACHINE_LEARNING_CLIP_TEXT_MODEL=clip-ViT-B-32-multilingual-v1 to it) ``` ### Reproduction steps ```bash 1. Add MACHINE_LEARNING_CLIP_TEXT_MODEL=clip-ViT-B-32-multilingual-v1 to your .env file 2. Start your machine-learning docker 3. It crashes with code 0 ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Jun 27, 2023):

@mertalev can you take a look at this?

@bo0tzz commented on GitHub (Jun 27, 2023): @mertalev can you take a look at this?
Author
Owner

@mertalev commented on GitHub (Jun 27, 2023):

Oh, I see why that error is happening. __subclasses__ only shows direct subclasses, so it doesn't include the stubs for using different clip image/text models.

@mertalev commented on GitHub (Jun 27, 2023): Oh, I see why that error is happening. `__subclasses__` only shows direct subclasses, so it doesn't include the stubs for using different clip image/text models.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1013