Cant get the face detection to work

Hey, i cant get the face detection to work. Everything else (smart search) etc works. I always got connection errors with facehugging (even though i can ping the site without problems and git clone also works without problems) so i manually downloaded the models. The model for smart search (clip model) works without problems, while im still getting connection errors for antelopev2, even though that model is also already downloaded. Machine_learning container logs [08/20/25 08:42:46] INFO Loading detection model 'antelopev2' to memory [08/20/25 08:42:46] INFO Setting execution providers to ['CPUExecutionProvider'], in descending order of preference [08/20/25 08:42:46] WARNING Failed to load detection model 'antelopev2'. Clearing cache. [08/20/25 08:42:46] INFO Cleared cache directory for model 'antelopev2'. [08/20/25 08:42:46] INFO Downloading detection model 'antelopev2'. This may take a while. [08/20/25 08:42:46] ERROR Exception in ASGI application And after that the web exceptions are logged. In the image is my folder structure for the ML Models. Is this wrong or does antelopev2 only have 1 folder? // Will add .env and compose file later
No description
22 Replies
Immich
Immich5d ago
:wave: Hey @AndroidNation, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
AndroidNation
AndroidNationOP5d ago
So apparently immich_machine_learning container deletes the subfolders and files of antelopev2 because its trying to clear cache and then it starts downloading the model and fails even though the site is reachable through all other means Is there a way to disable the download if i have the model manually downloaded? The clip model works just fine and is not getting deleted and it won't try to redownload it
Sergey Katsubo
This is how (auto)downloaded layout looks like
tree /cache

/cache
└── facial-recognition
└── antelopev2
├── README.md
├── detection
│   └── model.onnx
├── models--immich-app--antelopev2
│   └── refs
│   └── main
└── recognition
└── model.onnx
tree /cache

/cache
└── facial-recognition
└── antelopev2
├── README.md
├── detection
│   └── model.onnx
├── models--immich-app--antelopev2
│   └── refs
│   └── main
└── recognition
└── model.onnx
Perhaps your layout is different? https://github.com/immich-app/immich/blob/a1beb0a87d366c94677484ad1a10fac474cb6c68/machine-learning/immich_ml/main.py#L239-L241
Immich
Immich5d ago
except (OSError, InvalidProtobuf, BadZipFile, NoSuchFile):
log.warning(f"Failed to load {model.model_type.replace('_', ' ')} model '{model.model_name}'. Clearing cache.")
model.clear_cache()
except (OSError, InvalidProtobuf, BadZipFile, NoSuchFile):
log.warning(f"Failed to load {model.model_type.replace('_', ' ')} model '{model.model_name}'. Clearing cache.")
model.clear_cache()
Mraedis
Mraedis5d ago
Just to get the silly stuff out of the way, you do have enough space right?
AndroidNation
AndroidNationOP5d ago
This is how it looks before i start the job and then when its deleting the model cache it only has the antelopev2 folder Yeah otherwise git would give errors when cloning the repo into that folder? The VM has 50GB of nvme and only has debian, docker and immich running on it (the upload location is changed to a passthrough sata ssd but that shouldnt be relevant to immich_machine_learning right?)
Mraedis
Mraedis5d ago
Yes that's not relevant How much RAM does the VM have?
AndroidNation
AndroidNationOP5d ago
8 GB
Mraedis
Mraedis5d ago
Definitely should be enough :/ Could you try buffalo_l perhaps @AndroidNation
AndroidNation
AndroidNationOP5d ago
I have the same issues with buffalo_l I had the same issue with the clip models, thats why i even tried manually downloading them and for some reason it worked for the clip model but not for the facial recognition model xD
Mraedis
Mraedis5d ago
I'd wager the internet connection is somehow at fault But the question remains how/why
AndroidNation
AndroidNationOP5d ago
yeah but that shouldnt be a problem, if the model is manually downloaded? also ping, git and wget seem to have no issue to connect to huggingface i mean if the model is already in the model cache, the container shouldnt try to download it again, right?
Mraedis
Mraedis5d ago
Indeed, if the download is complete
AndroidNation
AndroidNationOP5d ago
just to be complete, this is the docker-compose file (should be the standard one without changes)
AndroidNation
AndroidNationOP5d ago
and the .env
AndroidNation
AndroidNationOP5d ago
# 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=/nas/immich

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./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=Europe/Berlin

# 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
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=redacted

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=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=/nas/immich

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./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=Europe/Berlin

# 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
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=redacted

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
AndroidNation
AndroidNationOP5d ago
also this is the folder structure before i start the job
No description
AndroidNation
AndroidNationOP5d ago
and this is the folder structure after i start the job :KEKW:
No description
AndroidNation
AndroidNationOP5d ago
i reinstalled git and it worked now, even though it shows the same amount and size of files being cloned
Mraedis
Mraedis5d ago
lol wtf
AndroidNation
AndroidNationOP5d ago
could have been an error with git-lfs maybe?
Mraedis
Mraedis5d ago
I have no idea

Did you find this page helpful?