Skip to content

Container fails to start on linux/arm64: basic-pitch has no inference backend #12

Description

@peterbjohnson

On Apple Silicon (linux/arm64) the built image never starts. Shimmy waits 15 s for the worker, the worker exits 1, and the container dies.

NameError: name '_default_model_type' is not defined
  File "/app/.venv/lib/python3.11/site-packages/basic_pitch/__init__.py", line 95

Cause: basic-pitch picks a backend at import and finds none. poetry.lock pins tensorflow for Linux, but the aarch64 tensorflow wheel on PyPI is an empty shim that requires tensorflow-cpu-aws, which Poetry never resolved into the lock. Importing tensorflow inside the arm64 container raises ModuleNotFoundError.

CI and the AWS build are x86_64, so they get the real wheel and pass. This only bites local development on arm64 machines.

Fix: add the onnx extra to basic-pitch in pyproject.toml:

basic-pitch = { version = "^0.4.0", extras = ["onnx"] }

onnxruntime has aarch64 wheels and is far smaller than TensorFlow, so this also shrinks the image. Verified locally: with onnxruntime installed the worker imports in 1.0 s and transcription works.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions