magenta / mt3

MT3: Multi-Task Multitrack Music Transcription
Apache License 2.0
1.43k stars 187 forks source link

Getting a ValueError when loading model #22

Closed dankmeemlord closed 2 years ago

dankmeemlord commented 2 years ago

When loading the mt3 model, I'm getting a valueerror: "Configurable 'models.ContinuousInputsEncoderDecoderModel.loss_fn' doesn't have a parameter named 'z_loss'. In file "/content/mt3/gin/model.gin", line 16 z_loss = %Z_LOSS ^" Not sure what this means since I know nothing about code but feel like it would be helpful to address.

buseynehannes commented 2 years ago

Having the same issue, It's actually due to a change in the t5x library. You can fix it for now by checking out a specific commit before the commit that broke it, in the notebook or installation put !cd t5x && pwd && git checkout c209e5d6e75f592414d5dd0b626fef0000f17b08 && cd.. under the clone of the t5x library !git clone --branch=main https://github.com/google-research/t5x

This fixed the issue for me

douxsh commented 2 years ago

I could not solve the problem even though I tried the method written above. Could you explain how to do this in more detail?

Spagheta-DSi commented 2 years ago

I got a different error now.


   2455           return results
   2456   err_str = 'Unable to open file: {}. Searched config paths: {}.'
-> 2457   raise IOError(err_str.format(config_file, prefixes))
   2458 
   2459 

OSError: Unable to open file: /content/mt3/gin/model.gin. Searched config paths: [''].
buseynehannes commented 2 years ago

Make sure you start from a clean runtime, reset the runtime if necessary First cel looks like this for me

#@markdown Install MT3 and its dependencies (may take a few minutes).

!apt-get update -qq && apt-get install -qq libfluidsynth1 build-essential libasound2-dev libjack-dev

!pip install --upgrade pip
!pip install --upgrade jaxlib -f https://storage.googleapis.com/jax-releases/jax_releases.html
!pip install nest-asyncio
!pip install pyfluidsynth

# install t5x
!git clone --branch=main https://github.com/google-research/t5x
!cd t5x && pwd && git checkout c209e5d6e75f592414d5dd0b626fef0000f17b08 && cd..
!mv t5x t5x_tmp; mv t5x_tmp/* .; rm -r t5x_tmp
!sed -i 's:jax\[tpu\]:jax:' setup.py
!python3 -m pip install -e .

# install mt3
!git clone --branch=main https://github.com/magenta/mt3
!mv mt3 mt3_tmp; mv mt3_tmp/* .; rm -r mt3_tmp
!python3 -m pip install -e .

# copy checkpoints
!gsutil -q -m cp -r gs://mt3/checkpoints .

# copy soundfont (originally from https://sites.google.com/site/soundfonts4u)
!gsutil -q -m cp gs://magentadata/soundfonts/SGM-v2.01-Sal-Guit-Bass-V1.3.sf2 .

everything else works from there

iansimon commented 2 years ago

This should be fixed once #23 is merged.

iansimon commented 2 years ago

Should be fixed now.