Skip to content

skills/transformation/depth-estimation falls through to torch, a dependency the macOS deploy path deliberately excludes #209

Description

@solderzzc

skills/transformation/depth-estimation falls through to a dependency the macOS deploy path deliberately excludes

Same bug class as #208 (YOLO detection): the accelerated-backend fallback chain has no path for "installed correctly, but the accelerated backend is unavailable here" — it eventually falls through to a dependency (torch) that the lightweight macOS deploy.sh path deliberately does not install.

Repro

Clean venv matching deploy.sh's macOS branch: coremltools 9.0, huggingface_hub, numpy 2.5.3, opencv-python-headless, Pillow, matplotlib — no onnxruntime/torch/depth-anything-v2.

Forced a CoreML load failure without touching the repo (pointed MODELS_DIR at a throwaway temp dir, no-op'd the HF download). The full fallback chain fires as designed, then dies unguarded:

CoreML load failed → falling back to PyTorch
ONNX Runtime load failed (No module named 'onnxruntime') → trying TensorRT
TensorRT unavailable (No module named 'torch') → falling back to PyTorch
  File ".../depth-estimation/scripts/transform.py", line 464, in _load_pytorch
      import torch
  ModuleNotFoundError: No module named 'torch'

The final fallback call (_load_pytorch) is unguarded — no try/except — so this ModuleNotFoundError propagates straight to the caller instead of a clean "no usable backend" error.

Secondary note

deploy.sh's macOS branch has no numpy<2.0 cap, unlike requirements_mps.txt for the YOLO skill (which pins numpy>=1.24.0,<2.0.0). Worth checking whether that's intentional or a consistency gap between the two skills' deploy paths.

Same fix shape as #208 likely applies here too: don't let the fallback chain reach torch on a deploy path that never installs it — fail with a clear "no accelerated backend available" message instead, or check framework_ok-equivalent before attempting the torch import.

🤖 Generated with Claude Code

Activity

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