Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when starting a face detection job #15979

Closed
1 of 3 tasks
kachuan opened this issue Feb 9, 2025 · 3 comments
Closed
1 of 3 tasks

Error when starting a face detection job #15979

kachuan opened this issue Feb 9, 2025 · 3 comments

Comments

@kachuan
Copy link

kachuan commented Feb 9, 2025

The bug

Hi,everyone. I have encountered an error when starting a face detection job . I have no idea whether is a bug or not.

I had deploy immich on ubuntu 22.04 (Vmware machine)with 2C4G . It all works well,but fails on my openwrt device.

  • Immich Server Logs

[Nest] 8 - 02/09/2025, 11:32:44 PM WARN [Microservices:MachineLearningRepository] Machine learning request to "http://immich-machine-learning:3003" failed with status 500: Internal Server Error
[Nest] 8 - 02/09/2025, 11:32:44 PM ERROR [Microservices:JobService] Unable to run job handler (faceDetection/face-detection): Error: Machine learning request '{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}' failed for all URLs
[Nest] 8 - 02/09/2025, 11:32:44 PM ERROR [Microservices:JobService] Error: Machine learning request '{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}' failed for all URLs
at MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine-learning.repository.js:38:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async MachineLearningRepository.detectFaces (/usr/src/app/dist/repositories/machine-learning.repository.js:47:26)
at async PersonService.handleDetectFaces (/usr/src/app/dist/services/person.service.js:228:52)
at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28)
at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13)
at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
[Nest] 8 - 02/09/2025, 11:32:44 PM ERROR [Microservices:JobService] Object:
{
"id": "c9064b8e-61c0-4cb6-935b-3aaa31cf237a"
}

  • Immich Machine Learning Logs
    `[02/09/25 23:32:31] DEBUG Setting model format to onnx
    [02/09/25 23:32:31] INFO Loading detection model 'buffalo_l' to memory
    [02/09/25 23:32:31] DEBUG Available ORT providers: {'CPUExecutionProvider',
    'AzureExecutionProvider'}
    [02/09/25 23:32:31] INFO Setting execution providers to
    ['CPUExecutionProvider'], in descending order of
    preference
    [02/09/25 23:32:31] DEBUG Setting execution provider options to
    [{'arena_extend_strategy': 'kSameAsRequested'}]
    [02/09/25 23:32:31] DEBUG Setting execution_mode to ORT_SEQUENTIAL
    [02/09/25 23:32:31] DEBUG Setting inter_op_num_threads to 1
    [02/09/25 23:32:31] DEBUG Setting intra_op_num_threads to 2
    [02/09/25 23:32:37] DEBUG Checking for inactivity...
    [02/09/25 23:32:40] DEBUG Setting model format to onnx
    [02/09/25 23:32:40] INFO Loading recognition model 'buffalo_l' to memory
    [02/09/25 23:32:40] DEBUG Available ORT providers: {'CPUExecutionProvider',
    'AzureExecutionProvider'}
    [02/09/25 23:32:40] INFO Setting execution providers to
    ['CPUExecutionProvider'], in descending order of
    preference
    [02/09/25 23:32:40] DEBUG Setting execution provider options to
    [{'arena_extend_strategy': 'kSameAsRequested'}]
    [02/09/25 23:32:40] DEBUG Setting execution_mode to ORT_SEQUENTIAL
    [02/09/25 23:32:40] DEBUG Setting inter_op_num_threads to 1
    [02/09/25 23:32:40] DEBUG Setting intra_op_num_threads to 2
    [02/09/25 23:32:40] ERROR Exception in ASGI application

                           ╭─────── Traceback (most recent call last) ───────╮
                           │ /usr/src/app/main.py:177 in predict             │
                           │                                                 │
                           │   174 │   │   inputs = text                     │
                           │   175 │   else:                                 │
                           │   176 │   │   raise HTTPException(400, "Either  │
                           │ ❱ 177 │   response = await run_inference(inputs │
                           │   178 │   return ORJSONResponse(response)       │
                           │   179                                           │
                           │   180                                           │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ entries = (                                 │ │
                           │ │           │   [                             │ │
                           │ │           │   │   {                         │ │
                           │ │           │   │   │   'name': 'buffalo_l',  │ │
                           │ │           │   │   │   'task':               │ │
                           │ │           'facial-recognition',             │ │
                           │ │           │   │   │   'type': 'detection',  │ │
                           │ │           │   │   │   'options': {          │ │
                           │ │           │   │   │   │   'minScore': 0.7   │ │
                           │ │           │   │   │   }                     │ │
                           │ │           │   │   }                         │ │
                           │ │           │   ],                            │ │
                           │ │           │   [                             │ │
                           │ │           │   │   {                         │ │
                           │ │           │   │   │   'name': 'buffalo_l',  │ │
                           │ │           │   │   │   'task':               │ │
                           │ │           'facial-recognition',             │ │
                           │ │           │   │   │   'type':               │ │
                           │ │           'recognition',                    │ │
                           │ │           │   │   │   'options': {}         │ │
                           │ │           │   │   }                         │ │
                           │ │           │   ]                             │ │
                           │ │           )                                 │ │
                           │ │   image = b'\xff\xd8\xff\xe2\x01\xf0ICC_PR… │ │
                           │ │           \x00\x00mntrRGB XYZ               │ │
                           │ │           \x07\xe2\x00\x03\x00\x14\x00\t\x… │ │
                           │ │  inputs = <PIL.JpegImagePlugin.JpegImageFi… │ │
                           │ │           image mode=RGB size=1440x1920 at  │ │
                           │ │           0x7F606933D0>                     │ │
                           │ │    text = None                              │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/main.py:202 in run_inference       │
                           │                                                 │
                           │   199 │   without_deps, with_deps = entries     │
                           │   200 │   await asyncio.gather(*[_run_inference │
                           │   201 │   if with_deps:                         │
                           │ ❱ 202 │   │   await asyncio.gather(*[_run_infer │
                           │   203 │   if isinstance(payload, Image):        │
                           │   204 │   │   response["imageHeight"], response │
                           │   205                                           │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │      entries = (                            │ │
                           │ │                │   [                        │ │
                           │ │                │   │   {                    │ │
                           │ │                │   │   │   'name':          │ │
                           │ │                'buffalo_l',                 │ │
                           │ │                │   │   │   'task':          │ │
                           │ │                'facial-recognition',        │ │
                           │ │                │   │   │   'type':          │ │
                           │ │                'detection',                 │ │
                           │ │                │   │   │   'options': {     │ │
                           │ │                │   │   │   │   'minScore':  │ │
                           │ │                0.7                          │ │
                           │ │                │   │   │   }                │ │
                           │ │                │   │   }                    │ │
                           │ │                │   ],                       │ │
                           │ │                │   [                        │ │
                           │ │                │   │   {                    │ │
                           │ │                │   │   │   'name':          │ │
                           │ │                'buffalo_l',                 │ │
                           │ │                │   │   │   'task':          │ │
                           │ │                'facial-recognition',        │ │
                           │ │                │   │   │   'type':          │ │
                           │ │                'recognition',               │ │
                           │ │                │   │   │   'options': {}    │ │
                           │ │                │   │   }                    │ │
                           │ │                │   ]                        │ │
                           │ │                )                            │ │
                           │ │      outputs = {                            │ │
                           │ │                │   (<ModelType.DETECTION:   │ │
                           │ │                'detection'>,                │ │
                           │ │                <ModelTask.FACIAL_RECOGNITI… │ │
                           │ │                'facial-recognition'>): {    │ │
                           │ │                │   │   'boxes': array([],   │ │
                           │ │                shape=(0, 4),                │ │
                           │ │                dtype=float32),              │ │
                           │ │                │   │   'scores': array([],  │ │
                           │ │                dtype=float32),              │ │
                           │ │                │   │   'landmarks':         │ │
                           │ │                array([], shape=(0, 5, 2),   │ │
                           │ │                dtype=float32)               │ │
                           │ │                │   }                        │ │
                           │ │                }                            │ │
                           │ │      payload = <PIL.JpegImagePlugin.JpegIm… │ │
                           │ │                image mode=RGB               │ │
                           │ │                size=1440x1920 at            │ │
                           │ │                0x7F606933D0>                │ │
                           │ │     response = {                            │ │
                           │ │                │   'facial-recognition': {  │ │
                           │ │                │   │   'boxes': array([],   │ │
                           │ │                shape=(0, 4),                │ │
                           │ │                dtype=float32),              │ │
                           │ │                │   │   'scores': array([],  │ │
                           │ │                dtype=float32),              │ │
                           │ │                │   │   'landmarks':         │ │
                           │ │                array([], shape=(0, 5, 2),   │ │
                           │ │                dtype=float32)               │ │
                           │ │                │   }                        │ │
                           │ │                }                            │ │
                           │ │    with_deps = [                            │ │
                           │ │                │   {                        │ │
                           │ │                │   │   'name': 'buffalo_l', │ │
                           │ │                │   │   'task':              │ │
                           │ │                'facial-recognition',        │ │
                           │ │                │   │   'type':              │ │
                           │ │                'recognition',               │ │
                           │ │                │   │   'options': {}        │ │
                           │ │                │   }                        │ │
                           │ │                ]                            │ │
                           │ │ without_deps = [                            │ │
                           │ │                │   {                        │ │
                           │ │                │   │   'name': 'buffalo_l', │ │
                           │ │                │   │   'task':              │ │
                           │ │                'facial-recognition',        │ │
                           │ │                │   │   'type': 'detection', │ │
                           │ │                │   │   'options': {         │ │
                           │ │                │   │   │   'minScore': 0.7  │ │
                           │ │                │   │   }                    │ │
                           │ │                │   }                        │ │
                           │ │                ]                            │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/main.py:194 in _run_inference      │
                           │                                                 │
                           │   191 │   │   │   except KeyError:              │
                           │   192 │   │   │   │   message = f"Task {entry[' │
                           │       output of {dep}"                          │
                           │   193 │   │   │   │   raise HTTPException(400,  │
                           │ ❱ 194 │   │   model = await load(model)         │
                           │   195 │   │   output = await run(model.predict, │
                           │   196 │   │   outputs[model.identity] = output  │
                           │   197 │   │   response[entry["task"]] = output  │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │      dep = (                                │ │
                           │ │            │   <ModelType.DETECTION:        │ │
                           │ │            'detection'>,                    │ │
                           │ │            │                                │ │
                           │ │            <ModelTask.FACIAL_RECOGNITION:   │ │
                           │ │            'facial-recognition'>            │ │
                           │ │            )                                │ │
                           │ │    entry = {                                │ │
                           │ │            │   'name': 'buffalo_l',         │ │
                           │ │            │   'task':                      │ │
                           │ │            'facial-recognition',            │ │
                           │ │            │   'type': 'recognition',       │ │
                           │ │            │   'options': {}                │ │
                           │ │            }                                │ │
                           │ │   inputs = [                                │ │
                           │ │            │                                │ │
                           │ │            <PIL.JpegImagePlugin.JpegImageF… │ │
                           │ │            image mode=RGB size=1440x1920 at │ │
                           │ │            0x7F606933D0>,                   │ │
                           │ │            │   {                            │ │
                           │ │            │   │   'boxes': array([],       │ │
                           │ │            shape=(0, 4), dtype=float32),    │ │
                           │ │            │   │   'scores': array([],      │ │
                           │ │            dtype=float32),                  │ │
                           │ │            │   │   'landmarks': array([],   │ │
                           │ │            shape=(0, 5, 2), dtype=float32)  │ │
                           │ │            │   }                            │ │
                           │ │            ]                                │ │
                           │ │    model = <app.models.facial_recognition.… │ │
                           │ │            object at 0x7f60691810>          │ │
                           │ │  outputs = {                                │ │
                           │ │            │   (<ModelType.DETECTION:       │ │
                           │ │            'detection'>,                    │ │
                           │ │            <ModelTask.FACIAL_RECOGNITION:   │ │
                           │ │            'facial-recognition'>): {        │ │
                           │ │            │   │   'boxes': array([],       │ │
                           │ │            shape=(0, 4), dtype=float32),    │ │
                           │ │            │   │   'scores': array([],      │ │
                           │ │            dtype=float32),                  │ │
                           │ │            │   │   'landmarks': array([],   │ │
                           │ │            shape=(0, 5, 2), dtype=float32)  │ │
                           │ │            │   }                            │ │
                           │ │            }                                │ │
                           │ │  payload = <PIL.JpegImagePlugin.JpegImageF… │ │
                           │ │            image mode=RGB size=1440x1920 at │ │
                           │ │            0x7F606933D0>                    │ │
                           │ │ response = {                                │ │
                           │ │            │   'facial-recognition': {      │ │
                           │ │            │   │   'boxes': array([],       │ │
                           │ │            shape=(0, 4), dtype=float32),    │ │
                           │ │            │   │   'scores': array([],      │ │
                           │ │            dtype=float32),                  │ │
                           │ │            │   │   'landmarks': array([],   │ │
                           │ │            shape=(0, 5, 2), dtype=float32)  │ │
                           │ │            │   }                            │ │
                           │ │            }                                │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/main.py:238 in load                │
                           │                                                 │
                           │   235 │   │   return model                      │
                           │   236 │                                         │
                           │   237 │   try:                                  │
                           │ ❱ 238 │   │   return await run(_load, model)    │
                           │   239 │   except (OSError, InvalidProtobuf, Bad │
                           │   240 │   │   log.warning(f"Failed to load {mod │
                           │       '{model.model_name}'. Clearing cache.")   │
                           │   241 │   │   model.clear_cache()               │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ model = <app.models.facial_recognition.rec… │ │
                           │ │         object at 0x7f60691810>             │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/main.py:213 in run                 │
                           │                                                 │
                           │   210 │   if thread_pool is None:               │
                           │   211 │   │   return func(*args, **kwargs)      │
                           │   212 │   partial_func = partial(func, *args, * │
                           │ ❱ 213 │   return await asyncio.get_running_loop │
                           │   214                                           │
                           │   215                                           │
                           │   216 async def load(model: InferenceModel) ->  │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │         args = (                            │ │
                           │ │                │                            │ │
                           │ │                <app.models.facial_recognit… │ │
                           │ │                object at 0x7f60691810>,     │ │
                           │ │                )                            │ │
                           │ │       kwargs = {}                           │ │
                           │ │ partial_func = functools.partial(<function  │ │
                           │ │                load.<locals>._load at       │ │
                           │ │                0x7f6063bba0>,               │ │
                           │ │                <app.models.facial_recognit… │ │
                           │ │                object at 0x7f60691810>)     │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/local/lib/python3.11/concurrent/futures/th │
                           │ read.py:58 in run                               │
                           │                                                 │
                           │ /usr/src/app/main.py:225 in _load               │
                           │                                                 │
                           │   222 │   │   │   raise HTTPException(500, f"Fa │
                           │   223 │   │   with lock:                        │
                           │   224 │   │   │   try:                          │
                           │ ❱ 225 │   │   │   │   model.load()              │
                           │   226 │   │   │   except FileNotFoundError as e │
                           │   227 │   │   │   │   if model.model_format ==  │
                           │   228 │   │   │   │   │   raise e               │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ model = <app.models.facial_recognition.rec… │ │
                           │ │         object at 0x7f60691810>             │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/models/base.py:53 in load          │
                           │                                                 │
                           │    50 │   │   self.download()                   │
                           │    51 │   │   attempt = f"Attempt #{self.load_a │
                           │       else "Loading"                            │
                           │    52 │   │   log.info(f"{attempt} {self.model_ │
                           │       '{self.model_name}' to memory")           │
                           │ ❱  53 │   │   self.session = self._load()       │
                           │    54 │   │   self.loaded = True                │
                           │    55 │                                         │
                           │    56 │   def predict(self, *inputs: Any, **mod │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ attempt = 'Loading'                         │ │
                           │ │    self = <app.models.facial_recognition.r… │ │
                           │ │           object at 0x7f60691810>           │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/models/facial_recognition/recognit │
                           │ ion.py:30 in _load                              │
                           │                                                 │
                           │   27 │   │   self.batch_size = max_batch_size i │
                           │   28 │                                          │
                           │   29 │   def _load(self) -> ModelSession:       │
                           │ ❱ 30 │   │   session = self._make_session(self. │
                           │   31 │   │   if (not self.batch_size or self.ba │
                           │      str(session.get_inputs()[0].shape[0]) != " │
                           │   32 │   │   │   self._add_batch_axis(self.mode │
                           │   33 │   │   │   session = self._make_session(s │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ self = <app.models.facial_recognition.reco… │ │
                           │ │        object at 0x7f60691810>              │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/models/base.py:110 in              │
                           │ _make_session                                   │
                           │                                                 │
                           │   107 │   │   │   case ".armnn":                │
                           │   108 │   │   │   │   session: ModelSession = A │
                           │   109 │   │   │   case ".onnx":                 │
                           │ ❱ 110 │   │   │   │   session = OrtSession(mode │
                           │   111 │   │   │   case _:                       │
                           │   112 │   │   │   │   raise ValueError(f"Unsupp │
                           │   113 │   │   return session                    │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ model_path = PosixPath('/cache/facial-reco… │ │
                           │ │       self = <app.models.facial_recognitio… │ │
                           │ │              object at 0x7f60691810>        │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /usr/src/app/sessions/ort.py:28 in __init__     │
                           │                                                 │
                           │    25 │   │   self.providers = providers if pro │
                           │    26 │   │   self.provider_options = provider_ │
                           │       self._provider_options_default            │
                           │    27 │   │   self.sess_options = sess_options  │
                           │       self._sess_options_default                │
                           │ ❱  28 │   │   self.session = ort.InferenceSessi │
                           │    29 │   │   │   self.model_path.as_posix(),   │
                           │    30 │   │   │   providers=self.providers,     │
                           │    31 │   │   │   provider_options=self.provide │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │       model_path = PosixPath('/cache/facia… │ │
                           │ │ provider_options = None                     │ │
                           │ │        providers = None                     │ │
                           │ │             self = <app.sessions.ort.OrtSe… │ │
                           │ │                    object at 0x7f609233d0>  │ │
                           │ │     sess_options = None                     │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /opt/venv/lib/python3.11/site-packages/onnxrunt │
                           │ ime/capi/onnxruntime_inference_collection.py:46 │
                           │ 5 in __init__                                   │
                           │                                                 │
                           │    462 │   │   disabled_optimizers = kwargs.get │
                           │    463 │   │                                    │
                           │    464 │   │   try:                             │
                           │ ❱  465 │   │   │   self._create_inference_sessi │
                           │        disabled_optimizers)                     │
                           │    466 │   │   except (ValueError, RuntimeError │
                           │    467 │   │   │   if self._enable_fallback:    │
                           │    468 │   │   │   │   try:                     │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ disabled_optimizers = None                  │ │
                           │ │              kwargs = {}                    │ │
                           │ │       path_or_bytes = '/cache/facial-recog… │ │
                           │ │    provider_options = [                     │ │
                           │ │                       │   {                 │ │
                           │ │                       │   │                 │ │
                           │ │                       'arena_extend_strate… │ │
                           │ │                       'kSameAsRequested'    │ │
                           │ │                       │   }                 │ │
                           │ │                       ]                     │ │
                           │ │           providers = [                     │ │
                           │ │                       │                     │ │
                           │ │                       'CPUExecutionProvide… │ │
                           │ │                       ]                     │ │
                           │ │                self = <onnxruntime.capi.on… │ │
                           │ │                       object at             │ │
                           │ │                       0x7f60d49210>         │ │
                           │ │        sess_options = <onnxruntime.capi.on… │ │
                           │ │                       object at             │ │
                           │ │                       0x7f609ff0b0>         │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           │                                                 │
                           │ /opt/venv/lib/python3.11/site-packages/onnxrunt │
                           │ ime/capi/onnxruntime_inference_collection.py:52 │
                           │ 6 in _create_inference_session                  │
                           │                                                 │
                           │    523 │   │   self._register_ep_custom_ops(ses │
                           │        available_providers)                     │
                           │    524 │   │                                    │
                           │    525 │   │   if self._model_path:             │
                           │ ❱  526 │   │   │   sess = C.InferenceSession(se │
                           │        self._read_config_from_model)            │
                           │    527 │   │   else:                            │
                           │    528 │   │   │   sess = C.InferenceSession(se │
                           │        self._read_config_from_model)            │
                           │    529                                          │
                           │                                                 │
                           │ ╭────────────────── locals ───────────────────╮ │
                           │ │ available_providers = [                     │ │
                           │ │                       │                     │ │
                           │ │                       'AzureExecutionProvi… │ │
                           │ │                       │                     │ │
                           │ │                       'CPUExecutionProvide… │ │
                           │ │                       ]                     │ │
                           │ │ disabled_optimizers = None                  │ │
                           │ │    provider_options = [                     │ │
                           │ │                       │   {                 │ │
                           │ │                       │   │                 │ │
                           │ │                       'arena_extend_strate… │ │
                           │ │                       'kSameAsRequested'    │ │
                           │ │                       │   }                 │ │
                           │ │                       ]                     │ │
                           │ │           providers = [                     │ │
                           │ │                       │                     │ │
                           │ │                       'CPUExecutionProvide… │ │
                           │ │                       ]                     │ │
                           │ │                self = <onnxruntime.capi.on… │ │
                           │ │                       object at             │ │
                           │ │                       0x7f60d49210>         │ │
                           │ │     session_options = <onnxruntime.capi.on… │ │
                           │ │                       object at             │ │
                           │ │                       0x7f609ff0b0>         │ │
                           │ ╰─────────────────────────────────────────────╯ │
                           ╰─────────────────────────────────────────────────╯
                           Fail: [ONNXRuntimeError] : 1 : FAIL : Load model
                           from
                           /cache/facial-recognition/buffalo_l/recognition/mod
                           el.onnx
                           failed:/onnxruntime_src/onnxruntime/core/graph/mode
                           l.cc:165
                           onnxruntime::Model::Model(onnx::ModelProto&&, const
                           onnxruntime::PathString&, const
                           onnxruntime::IOnnxRuntimeOpSchemaRegistryList*,
                           const onnxruntime::logging::Logger&, const
                           onnxruntime::ModelOptions&) ModelProto does not
                           have a graph.
    

[02/09/25 23:32:43] INFO Attempt #2 to load recognition model 'buffalo_l' to
memory
[02/09/25 23:32:43] DEBUG Available ORT providers: {'CPUExecutionProvider',
'AzureExecutionProvider'}
[02/09/25 23:32:43] INFO Setting execution providers to
['CPUExecutionProvider'], in descending order of
preference
[02/09/25 23:32:43] DEBUG Setting execution provider options to
[{'arena_extend_strategy': 'kSameAsRequested'}]
[02/09/25 23:32:43] DEBUG Setting execution_mode to ORT_SEQUENTIAL
[02/09/25 23:32:43] DEBUG Setting inter_op_num_threads to 1
[02/09/25 23:32:43] DEBUG Setting intra_op_num_threads to 2
`

  • OpenWrt Hardware
    Phicomm N1
    SoC:Allogic S905D 64bit 4Core Cortex-A53 1.5G Hz
    GPU:Mali-450
    RAM:2GB + 8GB Swap
    ROM:8GB eMMC

The OS that Immich Server is running on

Linux OpenWrt

Version of Immich Server

v1.125.7

Version of Immich Mobile App

v1.125.3

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# 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}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:905c4ee67b8e0aa955331960d2aa745781e6bd89afc44a8584bfd13bc890f0ae
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always
    environment:
      TZ: Asia/Shanghai
  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      TZ: Asia/Shanghai
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1;
        Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align
        --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')";
        echo "checksum failure count is $$Chksum";
        [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: >-
      postgres
      -c shared_preload_libraries=vectors.so
      -c 'search_path="$$user", public, vectors'
      -c logging_collector=on
      -c max_wal_size=2GB
      -c shared_buffers=512MB
      -c wal_compression=on
    restart: always

volumes:
  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 location where your database files are stored
DB_DATA_LOCATION=./data/postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC
TZ=Asia/Shanghai
CPU_CORES=2

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

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

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

IMMICH_LOG_LEVEL=debug

Reproduction steps

...

Relevant log output

Additional information

No response

@bo0tzz
Copy link
Member

bo0tzz commented Feb 9, 2025

Do I understand right that you're trying to run Immich on a piece of low-power networking hardware? That probably doesn't have enough resources to run Immich properly.

@kachuan
Copy link
Author

kachuan commented Feb 10, 2025

Do I understand right that you're trying to run Immich on a piece of low-power networking hardware? That probably doesn't have enough resources to run Immich properly.

Yeah,it is lower-powered. Actually, i don't need a high pefermance device.It's slow when uploading my photos at first time,but faster for daily-updated photos.It's ok that I can look up my photos on immich in hours.It will be fancy if it can handle face detection.
Now the problem is caused by cpu or memory limit, right?

@bo0tzz
Copy link
Member

bo0tzz commented Feb 10, 2025

Yes, I'm pretty sure the system is just not able to cope with what you're asking of it. Try disabling ML or running it remotely.

@bo0tzz bo0tzz closed this as completed Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants