Exception in Smart Search when using OpenVINO #2116

Closed
opened 2026-02-05 05:12:43 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @dvdblg on GitHub (Feb 3, 2024).

The bug

When launching a Smart Search Job, I'm getting an Exception for every image (or batch of images?) that is processed.
I have attached the exception traceback in the "additional information" box

The OS that Immich Server is running on

Unraid 6.12.6

Version of Immich Server

v1.94.1

Version of Immich Mobile App

v1.94.1

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    user: "${PUID}:${PGID}"
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always
    networks:
      - default
      - docker_socket
    deploy:
      resources:
        limits:
          memory: 512m
    #labels:
      #swag: enable
      #swag_port: 3001
      #swag_url: immich.*

  immich-microservices:
    user: "${PUID}:${PGID}"
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
      file: hwaccel.transcoding.yml 
      service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${APPDATA_IMMICH}/geocoding:${REVERSE_GEOCODING_DUMP_DIRECTORY}
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always
    networks:
      - default
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 1.5g

  immich-machine-learning:
    user: "${PUID}:${PGID}"
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
      file: hwaccel.ml.yml
      service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - ${APPDATA_IMMICH}/model-cache:/cache
    env_file:
      - .env
    restart: always
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 5g

  redis:
    user: "${PUID}:${PGID}"
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:afb290a0a0d0b2bd7537b62ebff1eb84d045c757c1c31ca2ca48c79536c0de82
    restart: always
    volumes:
      - ${APPDATA_IMMICH}/redis_data:/data
    networks:
      - default
    deploy:
      resources:
        limits:
          memory: 512m

  database:
    user: "${PUID}:${PGID}"
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ${APPDATA_IMMICH}/pgdata:/var/lib/postgresql/data
    networks:
      - default
    restart: always
    deploy:
      resources:
        limits:
            memory: 1g


networks:
  default:
  docker_socket:
    name: docker_socket
    external: true

Your .env content

# Base
TZ="Europe/Rome"
PUID=99
PGID=100
APPDATA=/mnt/user/appdata
APPDATA_IMMICH=${APPDATA}/immich


# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/user/photos/immich

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=xxxxx

REVERSE_GEOCODING_DUMP_DIRECTORY=/usr/src/app/geocoding
LOG_LEVEL=log

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=xxxxx
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Launch Smart Search Job
...

Additional information

This is the message I can read in the logs:

 [02/02/24 23:18:04] ERROR    Exception in ASGI application                      
                                                                            
                         ╭─────── Traceback (most recent call last) ───────╮
                         │ /usr/src/app/main.py:108 in predict             │
                         │                                                 │
                         │   105 │                                         │
                         │   106 │   model = await load(await model_cache. │
                         │   107 │   model.configure(**kwargs)             │
                         │ ❱ 108 │   outputs = await run(model.predict, in │
                         │   109 │   return ORJSONResponse(outputs)        │
                         │   110                                           │
                         │   111                                           │
                         │                                                 │
                         │ /usr/src/app/main.py:115 in run                 │
                         │                                                 │
                         │   112 async def run(func: Callable[..., Any], i │
                         │   113 │   if thread_pool is None:               │
                         │   114 │   │   return func(inputs)               │
                         │ ❱ 115 │   return await asyncio.get_running_loop │
                         │   116                                           │
                         │   117                                           │
                         │   118 async def load(model: InferenceModel) ->  │
                         │                                                 │
                         │ /usr/lib/python3.10/concurrent/futures/thread.p │
                         │ y:58 in run                                     │
                         │                                                 │
                         │ /usr/src/app/models/base.py:61 in predict       │
                         │                                                 │
                         │    58 │   │   self.load()                       │
                         │    59 │   │   if model_kwargs:                  │
                         │    60 │   │   │   self.configure(**model_kwargs │
                         │ ❱  61 │   │   return self._predict(inputs)      │
                         │    62 │                                         │
                         │    63 │   @abstractmethod                       │
                         │    64 │   def _predict(self, inputs: Any) -> An │
                         │                                                 │
                         │ /usr/src/app/models/clip.py:52 in _predict      │
                         │                                                 │
                         │    49 │   │   │   case Image.Image():           │
                         │    50 │   │   │   │   if self.mode == "text":   │
                         │    51 │   │   │   │   │   raise TypeError("Cann │
                         │ ❱  52 │   │   │   │   outputs: NDArray[np.float │
                         │       self.transform(image_or_text))[0][0]      │
                         │    53 │   │   │   case str():                   │
                         │    54 │   │   │   │   if self.mode == "vision": │
                         │    55 │   │   │   │   │   raise TypeError("Cann │
                         │                                                 │
                         │ /opt/venv/lib/python3.10/site-packages/onnxrunt │
                         │ ime/capi/onnxruntime_inference_collection.py:21 │
                         │ 9 in run                                        │
                         │                                                 │
                         │   216 │   │   if not output_names:              │
                         │   217 │   │   │   output_names = [output.name f │
                         │   218 │   │   try:                              │
                         │ ❱ 219 │   │   │   return self._sess.run(output_ │
                         │   220 │   │   except C.EPFail as err:           │
                         │   221 │   │   │   if self._enable_fallback:     │
                         │   222 │   │   │   │   print(f"EP Error: {str(er │
                         ╰─────────────────────────────────────────────────╯
                         RuntimeException: [ONNXRuntimeError] : 6 :         
                         RUNTIME_EXCEPTION : Encountered unknown exception  
                         in Run()
Originally created by @dvdblg on GitHub (Feb 3, 2024). ### The bug When launching a Smart Search Job, I'm getting an Exception for every image (or batch of images?) that is processed. I have attached the exception traceback in the "additional information" box ### The OS that Immich Server is running on Unraid 6.12.6 ### Version of Immich Server v1.94.1 ### Version of Immich Mobile App v1.94.1 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: immich-server: user: "${PUID}:${PGID}" container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - 2283:3001 depends_on: - redis - database restart: always networks: - default - docker_socket deploy: resources: limits: memory: 512m #labels: #swag: enable #swag_port: 3001 #swag_url: immich.* immich-microservices: user: "${PUID}:${PGID}" container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding file: hwaccel.transcoding.yml service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - ${APPDATA_IMMICH}/geocoding:${REVERSE_GEOCODING_DUMP_DIRECTORY} env_file: - .env depends_on: - redis - database restart: always networks: - default deploy: resources: limits: cpus: '1.0' memory: 1.5g immich-machine-learning: user: "${PUID}:${PGID}" container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration file: hwaccel.ml.yml service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - ${APPDATA_IMMICH}/model-cache:/cache env_file: - .env restart: always deploy: resources: limits: cpus: '2.0' memory: 5g redis: user: "${PUID}:${PGID}" container_name: immich_redis image: redis:6.2-alpine@sha256:afb290a0a0d0b2bd7537b62ebff1eb84d045c757c1c31ca2ca48c79536c0de82 restart: always volumes: - ${APPDATA_IMMICH}/redis_data:/data networks: - default deploy: resources: limits: memory: 512m database: user: "${PUID}:${PGID}" container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - ${APPDATA_IMMICH}/pgdata:/var/lib/postgresql/data networks: - default restart: always deploy: resources: limits: memory: 1g networks: default: docker_socket: name: docker_socket external: true ``` ### Your .env content ```Shell # Base TZ="Europe/Rome" PUID=99 PGID=100 APPDATA=/mnt/user/appdata APPDATA_IMMICH=${APPDATA}/immich # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/user/photos/immich # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password DB_PASSWORD=xxxxx REVERSE_GEOCODING_DUMP_DIRECTORY=/usr/src/app/geocoding LOG_LEVEL=log # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=xxxxx DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash 1. Launch Smart Search Job ... ``` ### Additional information This is the message I can read in the logs: [02/02/24 23:18:04] ERROR Exception in ASGI application ╭─────── Traceback (most recent call last) ───────╮ │ /usr/src/app/main.py:108 in predict │ │ │ │ 105 │ │ │ 106 │ model = await load(await model_cache. │ │ 107 │ model.configure(**kwargs) │ │ ❱ 108 │ outputs = await run(model.predict, in │ │ 109 │ return ORJSONResponse(outputs) │ │ 110 │ │ 111 │ │ │ │ /usr/src/app/main.py:115 in run │ │ │ │ 112 async def run(func: Callable[..., Any], i │ │ 113 │ if thread_pool is None: │ │ 114 │ │ return func(inputs) │ │ ❱ 115 │ return await asyncio.get_running_loop │ │ 116 │ │ 117 │ │ 118 async def load(model: InferenceModel) -> │ │ │ │ /usr/lib/python3.10/concurrent/futures/thread.p │ │ y:58 in run │ │ │ │ /usr/src/app/models/base.py:61 in predict │ │ │ │ 58 │ │ self.load() │ │ 59 │ │ if model_kwargs: │ │ 60 │ │ │ self.configure(**model_kwargs │ │ ❱ 61 │ │ return self._predict(inputs) │ │ 62 │ │ │ 63 │ @abstractmethod │ │ 64 │ def _predict(self, inputs: Any) -> An │ │ │ │ /usr/src/app/models/clip.py:52 in _predict │ │ │ │ 49 │ │ │ case Image.Image(): │ │ 50 │ │ │ │ if self.mode == "text": │ │ 51 │ │ │ │ │ raise TypeError("Cann │ │ ❱ 52 │ │ │ │ outputs: NDArray[np.float │ │ self.transform(image_or_text))[0][0] │ │ 53 │ │ │ case str(): │ │ 54 │ │ │ │ if self.mode == "vision": │ │ 55 │ │ │ │ │ raise TypeError("Cann │ │ │ │ /opt/venv/lib/python3.10/site-packages/onnxrunt │ │ ime/capi/onnxruntime_inference_collection.py:21 │ │ 9 in run │ │ │ │ 216 │ │ if not output_names: │ │ 217 │ │ │ output_names = [output.name f │ │ 218 │ │ try: │ │ ❱ 219 │ │ │ return self._sess.run(output_ │ │ 220 │ │ except C.EPFail as err: │ │ 221 │ │ │ if self._enable_fallback: │ │ 222 │ │ │ │ print(f"EP Error: {str(er │ ╰─────────────────────────────────────────────────╯ RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Encountered unknown exception in Run()
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2116