tensorflow / moonlight

Optical music recognition in TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: cannot import name 'music_pb2'

Cooperdamega opened this issue · comments

I tried following the command line usage on the README file. Bazel was able to build successfully, but trying to print the Score message gives me this error:

from protobuf import music_pb2 as protobuf_dot_music__pb2
ImportError: cannot import name 'music_pb2' from 'protobuf' (\?\C:\Users\UserName\AppData\Local\Temp\Bazel.runfiles_fvslv94m\runfiles_main_\moonlight\protobuf_init_.py)

I have the same (or at least related) issue, bazel build moonlight succesfully yet music_pb2 cannot be imported

Command(cmd)log:

C:\Users\Mariu\OMR\moonlight\bazel-bin\moonlight>omr moonlight/testdata/IMSLP00747-000.png
C:\Users\Mariu\OMR\venv\lib\site-packages\librosa\core\audio.py:33: UserWarning: Could not import scikits.samplerate. Falling back to scipy.signal
warnings.warn('Could not import scikits.samplerate. '
Traceback (most recent call last):
File "\?\C:\Users\Mariu\AppData\Local\Temp\Bazel.runfiles_i9rwhti1\runfiles_main_\moonlight\omr.py", line 30, in
from moonlight import conversions
File "\?\C:\Users\Mariu\AppData\Local\Temp\Bazel.runfiles_i9rwhti1\runfiles_main_\moonlight\conversions_init_.py", line 21, in
from moonlight.conversions.musicxml import score_to_musicxml
File "\?\C:\Users\Mariu\AppData\Local\Temp\Bazel.runfiles_i9rwhti1\runfiles_main_\moonlight\conversions\musicxml.py", line 30, in
from moonlight.protobuf import musicscore_pb2
File "\?\C:\Users\Mariu\AppData\Local\Temp\Bazel.runfiles_i9rwhti1\runfiles_main_\moonlight\protobuf\musicscore_pb2.py", line 15, in
from protobuf import music_pb2 as protobuf_dot_music__pb2
ImportError: cannot import name 'music_pb2'

i've tried googling the issue but ive found no solutions thusfar.

I'll clarify the README, we should have instructions for supporting Windows Subsystem Linux but not for Windows itself. The codebase is generally written to be platform-agnostic, but it looks like the Bazel directory structure may be inconsistent on Windows.

Pleasee Update the README :')

After trying to run moonlight on a M1 Mac, I discovered they are not compatible.

Now I have run into this error running on Windows, so this option is discarded as well.

Would also be amazing to have minimal version, without Bazel nor Protobuf imho.

Edit1: Not familiar with Bazel, any way to fix the directory structure for Windows?

Edit2: Any way to bypass the bazel client and run from a python IDE?

Thanks all.

This project isn't currently active, and our end goal is Cloud Compute over a static corpus of PNGs, so we are only looking at Linux. For debugging, the most comprehensive cross-platform solution would be a Linux VirtualBox and Jupyter notebook with port forwarding. It didn't reach the point yet of producing fuzzy, low-quality, but meaningful MusicXML files in bulk, so we're not working on a regular release yet which would get around limitations of building a Bazel project.