marcoppasini / musika

Fast Infinite Waveform Music Generation
MIT License
662 stars 49 forks source link

Google Colab version for Music Synthesis and Finetune problem #9

Closed DenisSergeevitch closed 2 years ago

DenisSergeevitch commented 2 years ago

I'm totally blown away by the speed and quality of the music generation tool you shared! Thank you so much!

I have started drafting Google Colab for Music Generation, and it works just fine, you can use it here.

However, the Finetuning process runs into a problem, after this command: python musika_train.py --train_path prepared_for_training --load_path /content/musika/checkpoints/misc --lr 0.00004

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/content/musika/musika_train.py", line 22, in <module>
    models_ls = M.initialize_networks()
  File "/content/musika/models.py", line 752, in initialize_networks
    (critic, gen, enc, dec, enc2, dec2, gen_ema, [opt_dec, opt_disc], switch) = self.get_networks()
  File "/content/musika/models.py", line 731, in get_networks
    ) = self.load(self.args.load_path, load_dec=False)
  File "/content/musika/models.py", line 661, in load
    opt_disc.set_weights(np.load(path + "/opt_disc.npy", allow_pickle=True))
  File "/usr/local/lib/python3.9/site-packages/numpy/lib/npyio.py", line 450, in load
    raise IOError(
OSError: Failed to interpret file '/content/musika/checkpoints/misc/opt_disc.npy' as a pickle

I have tried to edit npyio.py where I have allowed all allow_pickle=False parts, but it still does not help.

Thanks again for the amazing research!

marcoppasini commented 2 years ago

From what I understand git-lfs is installed by default in Colab but not properly setup.

Re-installing git-lfs should solve the problem and properly download the optimizer parameters!

!curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
!sudo apt-get install git-lfs

Thank you so much for the support and for trying out Musika!

marcoppasini commented 2 years ago

Just install git-lfs before cloning the repo (not after) and all the files should be downloaded properly. Sorry for not being specific in the previous message!

DenisSergeevitch commented 2 years ago

Yay, it's working now! Thank you a lot! <3

marcoppasini commented 2 years ago

Great! Nice to hear!

Pipazoul commented 2 years ago

The error is still hapenning, it seems tha you are out of lfs quota ^^

Error downloading object: checkpoints/misc/opt_dec.npy (f7495f9): Smudge error: Error downloading checkpoints/misc/opt_dec.npy (f7495f9af153b240b933af163704e826fd6777f3d0495a10d3e4192d5f52df94): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

Do you maybe have a mega or drive link ?

marcoppasini commented 2 years ago

Yes I reached the limit super fast, should work now! I will have to upload the optimizer files somewhere else

johnpaulbin commented 2 years ago

Yes I reached the limit super fast, should work now! I will have to upload the optimizer files somewhere else

@marcoppasini Have you tried creating a github release and putting the binary in there instead?

marcoppasini commented 2 years ago

Now model weights are downloaded from the huggingface Hub, so no more git lfs problems Thank you for reaching out and for the recommendation!