Skip to content

model_cls.emb_dim_seg not taken into account #15

Closed

Description

@afilt

Hi,

I noticed that at inference time for the segmentation task, the script with my custom model (specified with model_cls) was failing because the shape of the best checkpoint and the dimension of the embeddings were not matching. Indeed, my custom model has feature dimension 1536 for linear probing but 768 for segmentation. Checkpoint was expecting 768 but found 1536. I've added the following in train_eval_probe.py:359

    if model_cls is not None:
        OmegaConf.set_struct(cfg, False)
        cfg.pretrained_model = {"emb_dim": model_cls.emb_dim}
        if hasattr(model_cls, "emb_dim_seg"):
            cfg.pretrained_model.update({"emb_dim_seg": model_cls.emb_dim_seg})

Activity

  1. PierreMarza commented on May 7, 2026

    @PierreMarza
    Collaborator

    Hi @afilt!
    Indeed, thanks for reporting this! Latest commit integrates your code change suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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