You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[O] My problem is related to Spleeter only, not a derivative product (such as Webapplication, or GUI provided by others)
Description
On a windows PC, I was able to successfully run a command using 'spleeter separator test.mp3'. However, on my mac which runs macOS Big Sur with Apple M1, I get the following error when running the same command: zsh: illegal hardware instruction
My question is, is spleeter incompatible with Big Sur or Apple M1? I found that this was the case for tensorflow, and I'm curious if there is any way around this to run spleeter on my mac. Thanks.
Step to reproduce
Installed using pip with python 3.8
Ran as 'spleeter separator test.mp3' on terminal
Got 'illegal hardware instruction' error
Output
When I run the script I get the following error: zsh: illegal hardware instruction
My expectation was that it would run the same as on my PC, with a success message.
Hi @rappercodes,
we have not tested spleeter on Apple M1 yet, and it is very likely that the issue comes from an incompatibility issue.
We have no M1 available at the moment to investigate on this issue, but if you find any hints about what could fix the issue, let us know.
Anyone able to build a whl file for an M1 Pro running python 3.9? I can't seem to get it to build with bazel. Keeps erroring out. Super annoying. Not sure why this issue is closed. It should remain OPEN until there is an easier way to get this to run on M1...
Edit:
The error has to do with numpy (Executing genrule @local_config_python//:numpy_include failed (Exit 1)).
Trying some workarounds I saw but so far its been rough trying to get this to build through bazel.
Name: tensorflow-macos
Version: 2.7.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /Users/stevenslupsky/miniforge3/lib/python3.9/site-packages
Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, keras-preprocessing, libclang, numpy, opt-einsum, protobuf, six, tensorboard, tensorflow-estimator, termcolor, typing-extensions, wheel, wrapt
Required-by:
I installed ffmpeg and libsndfile successfully. When installing spleeter, I see an enormous number of error messages. At the end is the following:
ERROR: Cannot install spleeter==2.1.0 and spleeter==2.3.0 because these package versions have conflicting dependencies.
The conflict is caused by:
spleeter 2.3.0 depends on tensorflow==2.5.0
spleeter 2.1.0 depends on pandas==1.1.2
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
We, at Deezer, managed to use Spleeter on Mac M1 using Tensorflow Metal. Here are the instructions you must follow in order to complete the installation.
Upgrade your mac OS to Monterey (12.0.0+).
Switch to a Rosetta terminal.
Install Python 3.8. For now, we have not managed to run Metal on Python 3.9+, and Metal does not work for versions pre-3.8.
Download the .whl file that can be found here, and run the following command: python -m pip install --upgrade spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whl
Note that python refers to your local python3 installation. We recommend uninstalling the packages you have installed locally to avoid potential conflicting dependencies. Run the following a few times:
Test your new Spleeter installation using: python -m spleeter separate -p spleeter:2stems -o output audio_example.mp3
You can check your Activity Monitor to see the GPU being used.
We have also created branch for local development using Metal. Please run the following:
You are free to edit and update the dependencies in pyproject.toml and build your own .whl files using poetry install and poetry build (poetry tutorial).
Finally, please send us your feedback in the comments below. A more substantial release may follow if this fix ends up working for you!
Reacted by Tom, Karim, Ian Chen, Tucker Leavitt, John D. Pope, Felipe S. S. Schneider, Emerson Dove, Ignacio Eduardo Loyola Delgado, 🌵 Yun Wang, Matthew Webb and 1 more
We, at Deezer, managed to use Spleeter on Mac M1 using Tensorflow Metal. Here are the instructions you must follow in order to complete the installation.
Upgrade your mac OS to Monterey (12.0.0+).
Switch to a Rosetta terminal.
Install Python 3.8. For now, we have not managed to run Metal on Python 3.9+, and Metal does not work for versions pre-3.8.
Download the .whl file that can be found here, and run the following command: python -m pip install --upgrade spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whl
Note that python refers to your local python3 installation. We recommend uninstalling the packages you have installed locally to avoid potential conflicting dependencies. Run the following a few times:
Test your new Spleeter installation using: python -m spleeter separate -p spleeter:2stems -o output audio_example.mp3
You can check your Activity Monitor to see the GPU being used.
We have also created branch for local development using Metal. Please run the following:
You are free to edit and update the dependencies in pyproject.toml and build your own .whl files using poetry install and poetry build (poetry tutorial).
Finally, please send us your feedback in the comments below. A more substantial release may follow if this fix ends up working for you!
For all those that followed these instructions and had some troubles here is what I did that got this working on my 2020 M1 Mac Mini on 13.4.1.
To get a rosetta terminal: First, open a terminal and then use command
arch -x86_64 zsh
check with arch and the response should be i386 if you are now in a rosetta terminal.
Follow the instructions quoted above to run the command to install Spleeter to your python install
Don't bother running these two commands. They just uninstall everything installed to your python install.
On my first run of the spleeter tool I had an issue where the version of protobuf that came with the whl command step was too new. So I downgraded that to 3.20.1 but you could use any stable 3.20.* version
python -m pip install protobuf==3.20.*
Then I was getting an error that ffmpeg binary not installed.
I installed homebrew from brew.sh in an arm64 terminal
We, at Deezer, managed to use Spleeter on Mac M1 using Tensorflow Metal. Here are the instructions you must follow in order to complete the installation.
Upgrade your mac OS to Monterey (12.0.0+).
Switch to a Rosetta terminal.
Install Python 3.8. For now, we have not managed to run Metal on Python 3.9+, and Metal does not work for versions pre-3.8.
Download the .whl file that can be found here, and run the following command: python -m pip install --upgrade spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whl
Note that python refers to your local python3 installation. We recommend uninstalling the packages you have installed locally to avoid potential conflicting dependencies. Run the following a few times:
Test your new Spleeter installation using: python -m spleeter separate -p spleeter:2stems -o output audio_example.mp3
You can check your Activity Monitor to see the GPU being used.
We have also created branch for local development using Metal. Please run the following:
You are free to edit and update the dependencies in pyproject.toml and build your own .whl files using poetry install and poetry build (poetry tutorial).
Finally, please send us your feedback in the comments below. A more substantial release may follow if this fix ends up working for you!
hi
mac info:
Apple M1 Pro
macOs ventura 13.0
python version:3.8.18
I cannot install this whl.
python m pip install --upgrade spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whl ERROR: spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whl is not a supported wheel on this platform.
Getting the same issue as @BeatBoxerLrd. Trying to install from the .whl file fails with a "platform not supported" error, even with terminal running via Rosetta and arch set to x86_64 (i386)
However, I cannot run spleeter as I keep getting this message:
../spleeter2025/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
My python interpreter is definitely arm64, but this _cffi_backend.cpython-38-darwin.so is x86_64. I've tried to install it both using miniconda and miniforge3, but this cffi_backend seems to remain as a x86_64 file.
This also works for me, and I also get a substantial performance boost when I also pip install tensorflow-metal.
I suspect this is because py38 is so old that a lot of the packages in the transitive closure end up on versions with aggressively stable compatibility guarantees and it also bypasses features in the newer TF versions (in fact, following apple's instructions for TF metal fail for me on py310, py311, and py312 - so that's fun).
This also works for me, and I also get a substantial performance boost when I also pip install tensorflow-metal.
I don't think that you do.
Apple states (via Get started with tensorflow-metal) that V1 TensorFlow networks (i.e., Spleeter) are not currently supported, and when running Spleeter I see no GPU usage by it or any of its spawned processes. Furthermore, because tensorflow-metal doesn't support V1 networks, you can't just move the model to the GPU (well, you can try, but I hope you enjoy frustration and reading long tracebacks).
Without transitioning the network to V2 or using the checkpoints elsewhere, it seems everyone on a Mac is running this code on the CPU.
Activity
romi1502 commentedon Apr 15, 2021
Hi @rappercodes,
we have not tested spleeter on Apple M1 yet, and it is very likely that the issue comes from an incompatibility issue.
We have no M1 available at the moment to investigate on this issue, but if you find any hints about what could fix the issue, let us know.
e16m commentedon Apr 15, 2021
Thanks @romi1502. It does seem like an incompatibility issue. If I do come across anything I will share here.
Faylixe commentedon Apr 15, 2021
I confirm that Tensorflow compatibility with Apple M1 chip is not available at the moment, you can find some workaround based on Rosetta 2 here.
Do not hesitate to tell us if you manage to make it work with Rosetta, otherwise we will just wait a TF release that is compatible with M1 :)
d-dawg78 commentedon Apr 28, 2021
For those of you who want to run Spleeter on a Mac with M1 chips, you may find a guide for installing TF here:
https://drive.google.com/drive/folders/1oSipZLnoeQB0Awz8U68KYeCPsULy_dQ7?usp=sharing
And a guide for building and installing Spleeter here:
https://drive.google.com/drive/folders/1ioRr6-xRNizoR7xqWxXUdgjoijFOd2SC?usp=sharing
Note that this is a temporary fix, until TF is updated to run on these new chips. Enjoy!
kode54 commentedon Oct 4, 2021
Any updates?
konglong87 commentedon Oct 29, 2021
?
kpatdev commentedon Nov 14, 2021
Anyone able to build a whl file for an M1 Pro running python 3.9? I can't seem to get it to build with bazel. Keeps erroring out. Super annoying. Not sure why this issue is closed. It should remain OPEN until there is an easier way to get this to run on M1...
Edit:
The error has to do with numpy (Executing genrule @local_config_python//:numpy_include failed (Exit 1)).
Trying some workarounds I saw but so far its been rough trying to get this to build through bazel.
vumaasha commentedon Dec 10, 2021
is it possible to use dockerized images to workaround M1 specific issue?
tartale commentedon Dec 11, 2021
FWIW, I found this guide for tensorflow:
https://betterprogramming.pub/installing-tensorflow-on-apple-m1-with-new-metal-plugin-6d3cb9cb00ca
I'm going to still follow the workaround for spleeter, but if having a native M1 tensorflow install was a blocker, it may no longer be.
overdub60 commentedon Jan 12, 2022
Unfortunately, none of the suggested solutions have been working for me. Would really like this to work in my M1.
sslupsky commentedon Jan 23, 2022
I am attempting to install Spleeter on a MBP with M1 Max.
Apple published details of how to install Tensorflow on Apple Silicon Macs with Tensorflow Pluggable Device support for Metal here:
https://developer.apple.com/metal/tensorflow-plugin/
That installed Tensorflow 2.7.0
I installed ffmpeg and libsndfile successfully. When installing spleeter, I see an enormous number of error messages. At the end is the following:
d-dawg78 commentedon Jan 25, 2022
Hi all,
We, at Deezer, managed to use Spleeter on Mac M1 using Tensorflow Metal. Here are the instructions you must follow in order to complete the installation.
.whlfile that can be found here, and run the following command:python -m pip install --upgrade spleeter-2.3.0b0-cp38-cp38-macosx_11_0_x86_64.whlNote that
pythonrefers to your localpython3installation. We recommend uninstalling the packages you have installed locally to avoid potential conflicting dependencies. Run the following a few times:python -m spleeter separate -p spleeter:2stems -o output audio_example.mp3You can check your Activity Monitor to see the GPU being used.
We have also created branch for local development using Metal. Please run the following:
You are free to edit and update the dependencies in
pyproject.tomland build your own.whlfiles usingpoetry installandpoetry build(poetry tutorial).Finally, please send us your feedback in the comments below. A more substantial release may follow if this fix ends up working for you!
11 remaining items
adude007 commentedon Jul 2, 2023
For all those that followed these instructions and had some troubles here is what I did that got this working on my 2020 M1 Mac Mini on 13.4.1.
To get a rosetta terminal: First, open a terminal and then use command
check with
archand the response should bei386if you are now in a rosetta terminal.Follow the instructions quoted above to run the command to install Spleeter to your
pythoninstallDon't bother running these two commands. They just uninstall everything installed to your python install.
On my first run of the spleeter tool I had an issue where the version of protobuf that came with the whl command step was too new. So I downgraded that to 3.20.1 but you could use any stable 3.20.* version
Then I was getting an error that ffmpeg binary not installed.
I installed homebrew from brew.sh in an arm64 terminal
Use homebrew to Install ffmpeg with command
Then back in a rosetta terminal I was able to run the spleeter command successfully
python -m spleeter separate -p spleeter:2stems -o output audio_example.mp3BeatBoxerLrd commentedon Dec 27, 2023
hi
mac info:
Apple M1 Pro
macOs ventura 13.0
python version:3.8.18
I cannot install this whl.
thank you!!!
nihavend commentedon May 26, 2024
I made it work on M1 Pro Max with 3.8.10 but had to downgrade protobuf to 3.20.3
thanks
iserdmi commentedon Dec 6, 2024
M1. In my case this commands was successful:
bhkangw commentedon Dec 10, 2024
THIS WORKED THANK YOU. CLAUDE PLS INDEX THIS FIX 😆
bdotsamir commentedon Jan 4, 2025
Getting the same issue as @BeatBoxerLrd. Trying to install from the .whl file fails with a "platform not supported" error, even with terminal running via Rosetta and arch set to x86_64 (i386)
modestasgrz commentedon Jan 8, 2025
This worked on M3 Pro as well, thank you
stelladrinkwater commentedon Jan 8, 2025
Worked on Mac M1 Pro on OS 15.1!
acronomic commentedon Feb 21, 2025
Hi I was able to install spleeter with the commands listed on a Mac M1 on Sonoma 14.7.:
However, I cannot run spleeter as I keep getting this message:
../spleeter2025/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))My python interpreter is definitely arm64, but this _cffi_backend.cpython-38-darwin.so is x86_64. I've tried to install it both using miniconda and miniforge3, but this cffi_backend seems to remain as a x86_64 file.
Any help would be appreciated. Thank you.
irorange27 commentedon Apr 20, 2025
M4 works. Thanks.
madmecodes commentedon May 21, 2025
thnx worked on M2 air too, pip was giving trouble, dependency issues
Shravanthh commentedon Jul 6, 2025
This works for M4 mac running macOS 26
davingee commentedon Jul 21, 2025
Thank you Shravanthh works for me too! i spent quite a while trying to get this installed.
sxlijin commentedon Aug 14, 2025
This also works for me, and I also get a substantial performance boost when I also
pip install tensorflow-metal.I suspect this is because py38 is so old that a lot of the packages in the transitive closure end up on versions with aggressively stable compatibility guarantees and it also bypasses features in the newer TF versions (in fact, following apple's instructions for TF metal fail for me on py310, py311, and py312 - so that's fun).
itsmedonttell commentedon Aug 30, 2025
I don't think that you do.
Apple states (via Get started with tensorflow-metal) that V1 TensorFlow networks (i.e., Spleeter) are not currently supported, and when running Spleeter I see no GPU usage by it or any of its spawned processes. Furthermore, because tensorflow-metal doesn't support V1 networks, you can't just move the model to the GPU (well, you can try, but I hope you enjoy frustration and reading long tracebacks).
Without transitioning the network to V2 or using the checkpoints elsewhere, it seems everyone on a Mac is running this code on the CPU.