Skip to content

Report DINO import failures before checkpoint downloads - #1503

Open
sylvesterkaczmarek wants to merge 2 commits into
MouseLand:mainfrom
sylvesterkaczmarek:fix/1476-dino-dependency-error
Open

sylvesterkaczmarek wants to merge 2 commits into
MouseLand:mainfrom
sylvesterkaczmarek:fix/1476-dino-dependency-error

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Nov 7, 2026 •

Copy link
Copy Markdown

Refs #1476 and #1474.

Load DINOv3 only when a DINO model is requested. Missing or broken imports now raise an actionable ImportError with the README installation command and the original exception as its cause, instead of leaving undefined factory names. Built-in cpdino and cpdino-vitb selections check the dependency before creating the cache or downloading weights. Direct construction and local DINO checkpoints receive the same guidance; CPSAM and unrelated utilities do not require DINO.

This improves dependency handling and avoids wasted downloads. DINOv3 still needs to be installed separately. No model architecture or segmentation algorithm is changed.

Validation

  • All 13 new isolated regression cases pass; the original implementation fails 11, with two healthy-path controls passing.
  • Host model-free suite with --runslow: 31 passed and one existing CUDA-only skip, with unchanged candidate hashes.
  • Independent automated review reran all 13 cases, passed three additional corner checks and found no in-scope defects. A simulated core-only environment passed seven cases and skipped six backend-dependent controls.
  • Tests cover both variants, built-in and custom checkpoints, missing/nested import failures, retry, non-import exceptions and CPSAM isolation. Healthy controls use installed DINO factories with explicitly small constructor doubles; no full-size weights are downloaded.

The full model/data-dependent suite, end-to-end segmentation, native GUI and Windows/CUDA execution were not tested.

Follow-up repair and verification

A follow-up fixes the GUI dropdown route so known CPDINO models check DINOv3 dependencies before cache directory creation or checkpoint download. Two GUI regressions failed before the follow-up; after repair, all 21 focused tests passed, including all 13 prior dependency tests. This verifies GUI path selection with controlled cache/download boundaries, without loading pretrained weights or executing full GUI inference.

Contribution-policy disclosure

This implementation was prepared with coding-agent assistance. Cellpose CONTRIBUTING.md asks contributors to write implementations themselves rather than use AI agents. An explicit maintainer exception is needed to accept this assisted work; none is established. Human review and complete model-dependent slow-suite validation remain pending.

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

Successfully merging this pull request may close these issues.

1 participant