Code Monkey home page Code Monkey logo

Comments (18)

briansorahan avatar briansorahan commented on June 12, 2024 1

I'll give 3.10 a try today

from basic-pitch.

zhouyijian avatar zhouyijian commented on June 12, 2024

x86_64 tensorflow has this bug,
you can use arm64 tensorflow

from basic-pitch.

jonch070 avatar jonch070 commented on June 12, 2024

Also having trouble with this!

from basic-pitch.

dohertyguirand avatar dohertyguirand commented on June 12, 2024

Hi @briansorahan, thank you for flagging this! Are you able to upgrade to python 3.10? We are currently unable to support M1 hardware using older versions of python. Let me know if you run into issues with python 3.10.

You can also use a virtual machine for Windows or Mac with Intel hardware. I am working on documentation on how to do that now.

from basic-pitch.

dohertyguirand avatar dohertyguirand commented on June 12, 2024

Hi @jonch070, which version of python are you using? If you using a version less than 3.10 and have M1 hardware, try upgrading to python 3.10. We are currently unable to support M1 hardware using older versions of python.

from basic-pitch.

burcellf avatar burcellf commented on June 12, 2024

Hello, I'm also having the same 'illegal hardware instruction' error. I'm using:
Macbook Pro M1
MacOS 13.1
created a venv with Python 3.10

I also tried switching between the x86_64 and the arm64, but haven't been able to get this to run. Let me know what I can do to help.

Thank you in advance for your help as I'm really looking forward to trying out this package!

from basic-pitch.

dohertyguirand avatar dohertyguirand commented on June 12, 2024

Hey @burcellf, thanks for your message. What command did you run to install basic-pitch? Also which version of basic-pitch do you have?

from basic-pitch.

burcellf avatar burcellf commented on June 12, 2024

Hey @dohertyguirand, thank you for your prompt reply.

I installed basic-pitch using the following command:

conda create -c conda-forge  -n basic_pitch python=3.10

the .__version__ command says I'm running version: 0.2.4

from basic-pitch.

dohertyguirand avatar dohertyguirand commented on June 12, 2024

@burcellf Try installing with pip as we haven't made a proper conda installation.

from basic-pitch.

briansorahan avatar briansorahan commented on June 12, 2024

Here are the changes in my environment

python

python --version
Python 3.10.11

basic-pitch

Name: basic-pitch
Version: 0.2.4
Summary: Basic Pitch, a lightweight yet powerful audio-to-MIDI converter with pitch bend detection.
Home-page: https://github.com/spotify/basic-pitch
Author: Spotify
Author-email: [email protected]
License: Apache 2.0
Location: /Users/brian.soraham/miniconda3/lib/python3.10/site-packages
Requires: librosa, mir-eval, numpy, pretty-midi, resampy, scipy, tensorflow, typing-extensions
Required-by:

tensorflow (don't think I shared this before, but including it here since maybe it's relevant)

pip show tensorflow
Name: tensorflow
Version: 2.11.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /Users/brian.soraham/miniconda3/lib/python3.10/site-packages
Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, libclang, numpy, opt-einsum, packaging, protobuf, setuptools, six, tensorboard, tensorflow-estimator, tensorflow-io-gcs-filesystem, termcolor, typing-extensions, wrapt
Required-by: basic-pitch

Still getting the illegal hardware instruction error.

FWIW, I also tried the same command in a miniconda3:4.12.0 container and got this

✨✨✨✨✨✨✨✨✨
✨ Basic Pitch  ✨
✨✨✨✨✨✨✨✨✨

Importing Tensorflow (this may take a few seconds)...
The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

This was with python 3.10.11 too. I guess it's prob an issue with the virtual CPU in the VM that is running the container

from basic-pitch.

dohertyguirand avatar dohertyguirand commented on June 12, 2024

@briansorahan what command did you use to install basic-pitch? M1 hardware should be using tensorflow-macos instead of tensorflow. Let me know what you used and I will try to replicate.

from basic-pitch.

briansorahan avatar briansorahan commented on June 12, 2024

I used pip install basic-pitch but I am running my terminal (and tmux, which actually spawns my shell) with rosetta.
I've had too many build failures with arm64, e.g. grpcio
I should revisit this at some point though...

from basic-pitch.

dohertyguirand avatar dohertyguirand commented on June 12, 2024

@briansorahan Oh I see. We currently do not support rosetta. I've tried it myself in the past with basic-pitch and haven't gotten the entire installation workflow to succeed. I would recommend using arm64 architecture.

from basic-pitch.

briansorahan avatar briansorahan commented on June 12, 2024

@dohertyguirand Thanks! I'll give that a shot and circle back here with the results

from basic-pitch.

briansorahan avatar briansorahan commented on June 12, 2024

I forked the repo and added a dockerfile locally since docker is oftentimes my goto solution when I have trouble installing/running things on my macbook

FROM tensorflow/tensorflow:2.13.0
RUN  pip install basic-pitch
ENTRYPOINT ["basic-pitch"]

I built the image with

docker build -t basic-pitch .

I no longer see the illegal hardware instruction error, but the command takes a really long time (I've never actually seen it complete). I'm trying to get a MIDI file output from one of the audio files in this repo

mkdir output
docker run --rm -v $(pwd):/cwd -w /cwd basic-pitch output tests/resources/vocadito_10.wav

from basic-pitch.

drubinstein avatar drubinstein commented on June 12, 2024

How long are you experiencing? Tensorflow can take 5-10 seconds to import when running Python so it could be the overhead of the import.

from basic-pitch.

briansorahan avatar briansorahan commented on June 12, 2024

I let it run for at least 30 minutes just to see if it would ever complete, figuring maybe the audio file I used was weird somehow and triggered an edge case

from basic-pitch.

drubinstein avatar drubinstein commented on June 12, 2024

vocadito should be fine to work with. I'm wondering if it's a docker issue (are you using an x86 image instead of an ARM one). Regardless, I've been able to install basic-pitch on my M1 laptop and run audio through it without a problem. With tensorflow 2.13, basic-pitch 0.2.6 ran in < 10 seconds for vocadito_10.wav.

time basic-pitch /tmp  ~/git/basic-pitch/tests/resources/vocadito_10.wav
...
basic-pitch /tmp ~/git/basic-pitch/tests/resources/vocadito_10.wav  8.37s user 3.72s system 43% cpu 27.620 total

I'm curious what would happen if you tried to import tensorflow in a vanilla python shell on your machine. Otherwise, it could be helpful if you could try to pinpoint when the illegal instruction error is raised. You could try print-debugging, or the faulthandler / prepending PYTHONFAULTHANDLER=1 to your command.

from basic-pitch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.