Yujia-Yan / Skipping-The-Frame-Level

A simple yet effective Audio-to-Midi Automatic Piano Transcription system
MIT License
75 stars 8 forks source link

Received this error message trying to run this script #7

Closed JamesDuncanRobertson closed 1 year ago

JamesDuncanRobertson commented 1 year ago

I'm using MacOS Monterey with an M1 Chip.

[W NNPACK.cpp:53] Could not initialize NNPACK! Reason: Unsupported hardware. /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/bin/transkun", line 8, in sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/transkun/transcribe.py", line 57, in main fs, audio= readAudio(audioPath) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/transkun/transcribe.py", line 11, in readAudio audio = pydub.AudioSegment.from_mp3(path) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydub/audio_segment.py", line 796, in from_mp3 return cls.from_file(file, 'mp3', parameters=parameters) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydub/audio_segment.py", line 651, in from_file file, close_file = _fd_or_path_or_tempfile(file, 'rb', tempfile=False) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydub/utils.py", line 60, in _fd_or_path_or_tempfile fd = open(fd, mode=mode) FileNotFoundError: [Errno 2] No such file or directory: 'input.mp3'

Yujia-Yan commented 1 year ago

Hi,

It basically means that the audio file 'input.mp3' does not exist.

transkun input.mp3 output.mid

Here input.mp3 is the path to the input file and output.mid is where to put the result. The name input.mp3 and output.mid are just for illustration purpose.

JamesDuncanRobertson commented 1 year ago

Hi. It does exist though. I created an mp3 file and named it input.mp3.

do I have to give it the whole path?

JamesDuncanRobertson commented 1 year ago

OK I included the whole path and now I get the following messages: No such file or directory: 'ffprobe' Could not initialize NNPACK! Reason: Unsupported hardware.

Yujia-Yan commented 1 year ago

No such file or directory: 'ffprobe'

It looks like ffmpeg is not installed or in the system PATH.

Could not initialize NNPACK! Reason: Unsupported hardware.

This one is probably a warning. Otherwise there is something to do with pytorch installation.

JamesDuncanRobertson commented 1 year ago

I pip installed ffmpeg and ffprobe but it still is returning ffprobe not found message

Yujia-Yan commented 1 year ago

According to https://github.com/jiashaokun/ffmpeg, the ffmpeg package in pip is only a wrapper for calling the underlying commandline applications. On Mac, the quickest way to install certain package is using something like homebrew to do package management.

JamesDuncanRobertson commented 1 year ago

I installed ffmpeg and ffprobe and most crucially, moved that installation to the Path. But "Could not initialize NNPACK! Reason: Unsupported hardware." still results in a stalled run. Have you tried this on an M1 Mac? Seems to be related.

Yujia-Yan commented 1 year ago

Then it's a pytorch installation issue. I switched to M1 Macbook pro recently. After reinstalling homebrew and all its package after migrating from my old intel Macbook, everything works out of box. It looks like Mac has a built-in python and homebrew will install its own.

JamesDuncanRobertson commented 1 year ago

Any suggestions for me? I installed homebrew, pip, and all the requirements.

JamesDuncanRobertson commented 1 year ago

I don't know what I did, but now I am getting a zsh "permission denied" error on the input.mp3

Yujia-Yan commented 1 year ago

It sounds like you are getting trouble with the brew+python environment setup. I remembered there is something special to do for homebrew on M1 Mac (see https://earthly.dev/blog/homebrew-on-m1/). Then with homebrew, do a fresh installation of python pip and others

JamesDuncanRobertson commented 1 year ago

The script ran once and now has stopped working- strange.

JamesDuncanRobertson commented 1 year ago

Restarting my machine fixed the permission error. And the NNPack error was just a warning. By letting it hang, the transkun program worked as intended.

AMAZING software. This is game-changing transcription.

Yujia-Yan commented 1 year ago

Restarting my machine fixed the permission error. And the NNPack error was just a warning. By letting it hang, the transkun program worked as intended.

AMAZING software. This is game-changing transcription.

Thanks!