BreezeWhite / oemer

End-to-end Optical Music Recognition (OMR) system. Transcribe phone-taken music sheet image into MusicXML, which can be edited and converted to MIDI.
https://breezewhite.github.io/oemer/
MIT License
363 stars 42 forks source link

NumPy AttributeError #19

Closed Hymian7 closed 1 year ago

Hymian7 commented 1 year ago

Describe the bug oemer throws a NumPy AttributeError: module 'numpy' has no attribute 'int'

Python Version 3.8.10, also tried with 3.10 Windows 11

Input Image 0

Full Traceback oemer -d .\0.jpg 2022-12-22 20:10:28 No checkpoint found in c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\oemer\checkpoints/unet_big/model.onnx 2022-12-22 20:10:28 Downloading checkpoints (1/4) 1st_model.onnx: 100% 70767752/70767752 2022-12-22 20:12:32 Downloading checkpoints (2/4) 1st_weights.h5: 100% 70977288/70977288 2022-12-22 20:13:32 Downloading checkpoints (3/4) 2nd_model.onnx: 100% 38448467/38448467 2022-12-22 20:13:44 Downloading checkpoints (4/4) 2nd_weights.h5: 100% 38570576/38570576 2022-12-22 20:13:59 Extracting staffline and symbols c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:54: UserWarning: Specified provider 'CoreMLExecutionProvider' is not in available provider names.Available providers: 'CPUExecutionProvider' warnings.warn( c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:54: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'CPUExecutionProvider' warnings.warn( 1612 2280 2022-12-22 20:17:42 Extracting layers of different symbols 1612 2280 2022-12-22 20:24:35 Extracting stafflines Traceback (most recent call last): File "c:\users\hymian\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\hymian\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\hymian\AppData\Local\Programs\Python\Python38\Scripts\oemer.exe__main__.py", line 7, in File "c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\oemer\ete.py", line 276, in main mxl_path = extract(args) File "c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\oemer\ete.py", line 167, in extract staffs, zones = staff_extract() File "c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\oemer\staffline_extraction.py", line 327, in extract rr = np.array(rr, dtype=np.int) File "c:\users\hymian\appdata\local\programs\python\python38\lib\site-packages\numpy__init.py", line 284, in getattr__ raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'int' 60 239

Command You Execute oemer -d .\0.jpg

BreezeWhite commented 1 year ago

The new version of numpy removed np.int. You can solve the problem by downgrading to older version pip install numpy==1.23.5.

Hymian7 commented 1 year ago

Fixed it, thank you.

hendursaga commented 1 year ago

@BreezeWhite couldn't you use int_ or int64 or integer or something, instead? Those aliases I recall have been deprecated for awhile...

BreezeWhite commented 1 year ago

@hendursaga Yes, sure, I know they are deprecated. But it hasn't been deprecated until v1.24, which is the newest version of numpy. I currently have no time to fix it. If you don't mind, you could file a pull request to fix.