BShakhovsky / PolyphonicPianoTranscription

Recurrent Neural Network for generating piano MIDI-files from audio (MP3, WAV, etc.)
https://magenta.tensorflow.org/onsets-frames
230 stars 41 forks source link

cannot import name 'sequence_to_valued_intervals' from 'magenta.models.onsets_frames_transcription.metrics' #11

Closed Apichai9888 closed 8 months ago

Apichai9888 commented 2 years ago

Hello

Thank you these notebooks of onsets_and_frames model.

Previously, file 2 Training, Validation, Testing.ipynb that use magenta 2.1.3 is work but now in magenta 2.1.4 isn't work.

I try to run your code but found a problem that run on google colab.

ImportError: cannot import name 'sequence_to_valued_intervals' from 'magenta.models.onsets_frames_transcription.metrics' (/usr/local/lib/python3.7/dist-packages/magenta/models/onsets_frames_transcription/metrics.py)

I would like to ask you how to fix. Thank you so much.

1 2

BShakhovsky commented 2 years ago

Hello,

It seems that sequence_to_valued_intervals function has been moved to note_seq library, and here is that Magenta’s commit: https://github.com/magenta/magenta/pull/1880

So, the following line: from magenta.models.onsets_frames_transcription.metrics import sequence_to_valued_intervals should be changed to the following: from note_seq.sequences_lib import sequence_to_valued_intervals

Apichai9888 commented 2 years ago

Thank you very much