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

  1. peterbjohnson commented on Sep 9, 2026

    @peterbjohnson
    MemberAuthor

    Correction while working on this in #18: I wrote above that the onnx extra would also shrink the image. That is wrong.

    The extra adds a backend but does not remove tensorflow, which basic-pitch depends on unconditionally for non-Darwin platforms. Measured on arm64, the image grew from 1.4 GB to 1.46 GB.

    Dropping TensorFlow in favour of ONNX Runtime alone would genuinely shrink the amd64 image, but it changes which backend runs in production and would need a transcription-accuracy check, so it is out of scope for the startup fix. Worth its own issue if image size matters.

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