I
Immich•3y ago
moniker

machine learning offline cache

Hi, I'm trying to run the machine learning container offline. There are errors related to files not being found. I'm assuming they would end up in the model_cache folder. I'e attempted to clone the models from huggingface so they are loaded from disk. It doesn't seem to work though. Here is my mode_cache folder (note that I moved the models into the models--.. folders as they were created on startup).
-rw-r--r-- 1 moniker root 1 Apr 29 20:33 version.txt

models--microsoft--resnet-50:
total 300653
drwxr-xr-x 3 moniker root 9 Apr 29 21:00 .
drwxr-xr-x 3 moniker root 4 Apr 29 21:00 resnet-50
drwxr-xr-x 5 moniker root 6 Apr 29 20:49 ..
-rw-r--r-- 1 moniker root 102567489 Apr 29 20:40 pytorch_model.bin
-rw-r--r-- 1 moniker root 102450913 Apr 29 20:40 flax_model.msgpack
-rw-r--r-- 1 moniker root 102753944 Apr 29 20:40 tf_model.h5
-rw-r--r-- 1 moniker root 266 Apr 29 20:40 preprocessor_config.json
-rw-r--r-- 1 moniker root 69556 Apr 29 20:40 config.json
-rw-r--r-- 1 moniker root 2642 Apr 29 20:40 README.md

models--hustvl--yolos-tiny:
total 25432
drwxr-xr-x 3 moniker root 7 Apr 29 21:00 .
drwxrwxr-x 3 moniker moniker 4 Apr 29 21:00 yolos-tiny
drwxr-xr-x 5 moniker root 6 Apr 29 20:49 ..
-rw-rw-r-- 1 moniker moniker 26021147 Apr 29 20:41 pytorch_model.bin
-rw-rw-r-- 1 moniker moniker 4133 Apr 29 20:41 config.json
-rw-rw-r-- 1 moniker moniker 275 Apr 29 20:41 preprocessor_config.json
-rw-rw-r-- 1 moniker moniker 4159 Apr 29 20:41 README.md

.:
total 43
drwxr-xr-x 3 moniker root 9 Apr 29 21:00 models--microsoft--resnet-50
drwxr-xr-x 3 moniker root 7 Apr 29 21:00 models--hustvl--yolos-tiny
drwxr-xr-x 5 moniker root 6 Apr 29 20:49 .
drwxrwxr-x 4 moniker moniker 8 Apr 29 20:41 clip-ViT-B-32
-rw-r--r-- 1 moniker root 1 Apr 29 20:33 version.txt
drwxr-xr-x 7 moniker root 9 Apr 29 20:33 ..
-rw-r--r-- 1 moniker root 1 Apr 29 20:33 version.txt

models--microsoft--resnet-50:
total 300653
drwxr-xr-x 3 moniker root 9 Apr 29 21:00 .
drwxr-xr-x 3 moniker root 4 Apr 29 21:00 resnet-50
drwxr-xr-x 5 moniker root 6 Apr 29 20:49 ..
-rw-r--r-- 1 moniker root 102567489 Apr 29 20:40 pytorch_model.bin
-rw-r--r-- 1 moniker root 102450913 Apr 29 20:40 flax_model.msgpack
-rw-r--r-- 1 moniker root 102753944 Apr 29 20:40 tf_model.h5
-rw-r--r-- 1 moniker root 266 Apr 29 20:40 preprocessor_config.json
-rw-r--r-- 1 moniker root 69556 Apr 29 20:40 config.json
-rw-r--r-- 1 moniker root 2642 Apr 29 20:40 README.md

models--hustvl--yolos-tiny:
total 25432
drwxr-xr-x 3 moniker root 7 Apr 29 21:00 .
drwxrwxr-x 3 moniker moniker 4 Apr 29 21:00 yolos-tiny
drwxr-xr-x 5 moniker root 6 Apr 29 20:49 ..
-rw-rw-r-- 1 moniker moniker 26021147 Apr 29 20:41 pytorch_model.bin
-rw-rw-r-- 1 moniker moniker 4133 Apr 29 20:41 config.json
-rw-rw-r-- 1 moniker moniker 275 Apr 29 20:41 preprocessor_config.json
-rw-rw-r-- 1 moniker moniker 4159 Apr 29 20:41 README.md

.:
total 43
drwxr-xr-x 3 moniker root 9 Apr 29 21:00 models--microsoft--resnet-50
drwxr-xr-x 3 moniker root 7 Apr 29 21:00 models--hustvl--yolos-tiny
drwxr-xr-x 5 moniker root 6 Apr 29 20:49 .
drwxrwxr-x 4 moniker moniker 8 Apr 29 20:41 clip-ViT-B-32
-rw-r--r-- 1 moniker root 1 Apr 29 20:33 version.txt
drwxr-xr-x 7 moniker root 9 Apr 29 20:33 ..
6 Replies
bo0tzz
bo0tzz•3y ago
Not all models are being cached to the correct folder yet, that's a bug we still need to fix 😅
moniker
monikerOP•3y ago
It doesn't seem like any of them get loaded from cache, but it could just be erroring on the first one. Hmm would it then be in whatever cache huggingface makes by default?
bo0tzz
bo0tzz•3y ago
Probably yeah
moniker
monikerOP•3y ago
OK cool, I'll give it a try. Worst comes to worst it seems like huggingface might fall back to looking for pwd/org/modelname? Definitely interesting way to make downloads easy lol Thanks Cool, cwd worked!
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- ./model-cache/yolos-tiny:/usr/src/app/hustvl/yolos-tiny
- ./model-cache/resnet-50:/usr/src/app/microsoft/resnet-50
- ./model-cache/clip-ViT-B-32:/usr/src/app/clip-ViT-B-32
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- ./model-cache/yolos-tiny:/usr/src/app/hustvl/yolos-tiny
- ./model-cache/resnet-50:/usr/src/app/microsoft/resnet-50
- ./model-cache/clip-ViT-B-32:/usr/src/app/clip-ViT-B-32
Taha
Taha•3y ago
Is there a relevant issue on GitHub?
Alex Tran
Alex Tran•3y ago
I believe we fixed this issue in the Facial Recognition PR it will me merged into main at some point before the next release

Did you find this page helpful?