sweetcocoa / pop2piano

Official Repo of the paper "Pop2Piano : Pop Audio-based Piano Cover Generation"
454 stars 46 forks source link

Error in Colab script #14

Closed susnato closed 1 year ago

susnato commented 1 year ago

First of all, very cool project :+1: . Now the error,

I tried to run the colab script and in this code block -

device = "cuda" if torch.cuda.is_available() else "cpu"
config = OmegaConf.load("pop2piano/config.yaml")
wrapper = TransformerWrapper(config)
wrapper = wrapper.load_from_checkpoint("model-1999-val_0.67311615.ckpt", config=config).to(device)
model = "dpipqxiy"
wrapper.eval()
""

I got this error -

KeyError                                  Traceback (most recent call last)

[<ipython-input-2-f76a479c8023>](https://localhost:8080/#) in <module>
      2 config = OmegaConf.load("pop2piano/config.yaml")
      3 wrapper = TransformerWrapper(config)
----> 4 wrapper = wrapper.load_from_checkpoint("model-1999-val_0.67311615.ckpt", config=config).to(device)
      5 model = "dpipqxiy"
      6 wrapper.eval()

4 frames

[/usr/local/lib/python3.8/dist-packages/pytorch_lightning/utilities/migration/migration.py](https://localhost:8080/#) in _migrate_loop_global_step_to_progress_tracking(checkpoint)
     83     PR: #13645, #11805
     84     """
---> 85     global_step = checkpoint["global_step"]
     86     checkpoint.setdefault("loops", {"fit_loop": _get_fit_loop_initial_state_1_6_0()})
     87     checkpoint["loops"].setdefault("fit_loop", _get_fit_loop_initial_state_1_6_0())

KeyError: 'global_step'

I think there might be a problem with checkpoint, but not entirely sure.

susnato commented 1 year ago

I managed to figure out what was causing the issue, it was a differnt version of pytorch-lightning used in the code and the colab has a different version we need to install pytorch-lightning==1.8.4 to run it successfully in colab.