[BUG] Image Tagging does not work #1928

Closed
opened 2026-02-05 04:29:00 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @jee-r on GitHub (Jan 3, 2024).

The bug

Hello,

I get this error with a fresh docker install :

docker compose logs -f
immich_machine_learning  | [01/03/24 15:27:14] INFO     Starting gunicorn 21.2.0                           
immich_machine_learning  | [01/03/24 15:27:14] INFO     Listening at: http://0.0.0.0:3003 (9)              
immich_machine_learning  | [01/03/24 15:27:14] INFO     Using worker: app.config.CustomUvicornWorker       
immich_machine_learning  | [01/03/24 15:27:14] INFO     Booting worker with pid: 17                        
immich_machine_learning  | [01/03/24 15:27:24] INFO     Created in-memory cache with unloading after 300s  
immich_machine_learning  |                              of inactivity.                                     
immich_machine_learning  | [01/03/24 15:27:24] INFO     Initialized request thread pool with 8 threads.    
immich_machine_learning  | [01/03/24 15:28:09] INFO     Downloading image classification model             
immich_machine_learning  |                              'microsoft/resnet-50'.This may take a while.       
Downloading (…)rocessor_config.json: 100%|██████████| 266/266 [00:00<00:00, 1.13MB/s]
Downloading config.json: 100%|██████████| 69.6k/69.6k [00:00<00:00, 839kB/s]s]
Downloading pytorch_model.bin: 100%|██████████| 103M/103M [00:05<00:00, 20.1MB/s]
Fetching 3 files: 100%|██████████| 3/3 [00:06<00:00,  2.10s/it]5<00:00, 21.4MB/s] 
immich_machine_learning  | [01/03/24 15:28:16] INFO     Loading image classification model                 
immich_machine_learning  |                              'microsoft/resnet-50'                              
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  | [01/03/24 15:28:16] INFO     ONNX model not found in cache directory for        
immich_machine_learning  |                              'microsoft/resnet-50'.Exporting optimized model for
immich_machine_learning  |                              future use.                                        
Downloading config.json: 100%|██████████| 69.6k/69.6k [00:00<00:00, 551kB/s]
immich_machine_learning  | Framework not specified. Using pt to export to ONNX.
Downloading (…)rocessor_config.json: 100%|██████████| 266/266 [00:00<00:00, 1.34MB/s]
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  | /opt/venv/lib/python3.11/site-packages/transformers/models/convnext/feature_extraction_convnext.py:28: FutureWarning: The class ConvNextFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use ConvNextImageProcessor instead.
immich_machine_learning  |   warnings.warn(
immich_machine_learning  | Using the export variant default. Available variants are:
immich_machine_learning  | 	- default: The default ONNX variant.
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  | Using framework PyTorch: 2.1.0+cpu
immich_machine_learning  | /opt/venv/lib/python3.11/site-packages/transformers/models/resnet/modeling_resnet.py:95: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
immich_machine_learning  |   if num_channels != self.num_channels:
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  | 2024-01-03 15:28:26.920973925 [W:onnxruntime:, inference_session.cc:1732 Initialize] Serializing optimized model with Graph Optimization level greater than ORT_ENABLE_EXTENDED and the NchwcTransformer enabled. The generated model may contain hardware specific optimizations, and should only be used in the same environment the model was optimized in.

The OS that Immich Server is running on

Synology DSM 7.1 (kernel 4.4.1)

Version of Immich Server

v1.91.4

Version of Immich Mobile App

latest

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:
    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

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc
    restart: always

  database:
    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:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

# 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=./library

# 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=REDACTED

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

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. follow official install instruction
2. add photos
3. enable Image Tagging feature in machine learning settings
4. scan your library

Additional information

i have tried/checked everything

  • permissions
  • clean model cache volume
  • reinstall from scratch
  • running the machine-learning container on my laptop

i always get this error, with Image Tagging task, facial recognition and others tasks seems working.

Any assistance in resolving the issue would be greatly appreciated. Thank you

Originally created by @jee-r on GitHub (Jan 3, 2024). ### The bug Hello, I get this error with a fresh docker install : ``` docker compose logs -f immich_machine_learning | [01/03/24 15:27:14] INFO Starting gunicorn 21.2.0 immich_machine_learning | [01/03/24 15:27:14] INFO Listening at: http://0.0.0.0:3003 (9) immich_machine_learning | [01/03/24 15:27:14] INFO Using worker: app.config.CustomUvicornWorker immich_machine_learning | [01/03/24 15:27:14] INFO Booting worker with pid: 17 immich_machine_learning | [01/03/24 15:27:24] INFO Created in-memory cache with unloading after 300s immich_machine_learning | of inactivity. immich_machine_learning | [01/03/24 15:27:24] INFO Initialized request thread pool with 8 threads. immich_machine_learning | [01/03/24 15:28:09] INFO Downloading image classification model immich_machine_learning | 'microsoft/resnet-50'.This may take a while. Downloading (…)rocessor_config.json: 100%|██████████| 266/266 [00:00<00:00, 1.13MB/s] Downloading config.json: 100%|██████████| 69.6k/69.6k [00:00<00:00, 839kB/s]s] Downloading pytorch_model.bin: 100%|██████████| 103M/103M [00:05<00:00, 20.1MB/s] Fetching 3 files: 100%|██████████| 3/3 [00:06<00:00, 2.10s/it]5<00:00, 21.4MB/s] immich_machine_learning | [01/03/24 15:28:16] INFO Loading image classification model immich_machine_learning | 'microsoft/resnet-50' 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 | [01/03/24 15:28:16] INFO ONNX model not found in cache directory for immich_machine_learning | 'microsoft/resnet-50'.Exporting optimized model for immich_machine_learning | future use. Downloading config.json: 100%|██████████| 69.6k/69.6k [00:00<00:00, 551kB/s] immich_machine_learning | Framework not specified. Using pt to export to ONNX. Downloading (…)rocessor_config.json: 100%|██████████| 266/266 [00:00<00:00, 1.34MB/s] 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 | /opt/venv/lib/python3.11/site-packages/transformers/models/convnext/feature_extraction_convnext.py:28: FutureWarning: The class ConvNextFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use ConvNextImageProcessor instead. immich_machine_learning | warnings.warn( immich_machine_learning | Using the export variant default. Available variants are: immich_machine_learning | - default: The default ONNX variant. 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 | Using framework PyTorch: 2.1.0+cpu immich_machine_learning | /opt/venv/lib/python3.11/site-packages/transformers/models/resnet/modeling_resnet.py:95: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! immich_machine_learning | if num_channels != self.num_channels: 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 | 2024-01-03 15:28:26.920973925 [W:onnxruntime:, inference_session.cc:1732 Initialize] Serializing optimized model with Graph Optimization level greater than ORT_ENABLE_EXTENDED and the NchwcTransformer enabled. The generated model may contain hardware specific optimizations, and should only be used in the same environment the model was optimized in. ``` ### The OS that Immich Server is running on Synology DSM 7.1 (kernel 4.4.1) ### Version of Immich Server v1.91.4 ### Version of Immich Mobile App latest ### 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: 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 immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env depends_on: - redis - database restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc restart: always database: 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: - pgdata:/var/lib/postgresql/data restart: always volumes: pgdata: model-cache: ``` ### Your .env content ```Shell # 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=./library # 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=REDACTED # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash 1. follow official install instruction 2. add photos 3. enable Image Tagging feature in machine learning settings 4. scan your library ``` ### Additional information i have tried/checked everything - permissions - clean model cache volume - reinstall from scratch - running the machine-learning container on my laptop i always get this error, with Image Tagging task, facial recognition and others tasks seems working. Any assistance in resolving the issue would be greatly appreciated. Thank you * certainly related to https://github.com/immich-app/immich/issues/6089
Author
Owner

@alextran1502 commented on GitHub (Jan 3, 2024):

The image tagging job will be removed in the next release since we don't use that information for anything at the moment.

@alextran1502 commented on GitHub (Jan 3, 2024): The image tagging job will be removed in the next release since we don't use that information for anything at the moment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1928