Skip to content

microsoft/resnet-18 fails with "Model not supported" (panic) via EmbeddingModel.from_pretrained_hf #197

@mnm-matin

Description

@mnm-matin

Hi EmbedAnything team — thanks for the great project.

I’m trying to use a HuggingFace ResNet as an image embedding backbone via the Python API, but microsoft/resnet-18 is rejected as "Model not supported" and the process panics (PyO3 unwrap), even though the README/Docs say "We support any hugging-face models on Candle".

Repro

from embed_anything import EmbeddingModel

EmbeddingModel.from_pretrained_hf(model_id="microsoft/resnet-18")

Output

It panics inside the Rust extension:

thread '<unnamed>' panicked at python/src/lib.rs:175:84:
called `Result::unwrap()` on an `Err` value: Model not supported

pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: Model not supported

With RUST_BACKTRACE=1, the panic originates from the _embed_anything module init path (still ends in the same unwrap at python/src/lib.rs:175:84).

Sanity checks

These work fine in the same environment:

EmbeddingModel.from_pretrained_hf(model_id="openai/clip-vit-base-patch32")
EmbeddingModel.from_pretrained_hf(model_id="google/siglip-base-patch16-224")

So it looks like the HF loader supports some vision architectures (CLIP/SigLIP), but not ResNet.

Environment

  • OS: macOS
  • Python: 3.12
  • embed-anything: 0.7.0

Questions / request

  1. Is ResNet support planned (e.g. microsoft/resnet-18, microsoft/resnet-50) for image embeddings?
  2. If not supported, could the docs/README be clarified? The statement "We support any hugging-face models on Candle" reads like arbitrary HF architectures should work.
  3. Could the Python binding avoid panicking on unsupported models and instead raise a normal Python exception (with a list of supported architectures / next steps)?

Reference: fastembed supports ResNet50

As a point of comparison, Qdrant’s fastembed supports ResNet-50 image embeddings via an ONNX model (Qdrant/resnet50-onnx, dim=2048). Example:

from fastembed import ImageEmbedding
model = ImageEmbedding(model_name="Qdrant/resnet50-onnx")

It would be awesome if EmbedAnything could support a similar ResNet image embedder (via Candle or ONNX).

Happy to test a PR / nightly build if you have guidance on how best to add this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions