harubaru / waifu-diffusion

stable diffusion finetuned on weeb stuff
GNU Affero General Public License v3.0
1.94k stars 177 forks source link

KeyError: 'Trying to restore optimizer state but checkpoint contains only the model. #19

Closed jianpingliu closed 1 year ago

jianpingliu commented 1 year ago

Followed the instruction step by step, got this error:

Traceback (most recent call last): File "waifu-diffusion/main.py", line 721, in trainer.fit(model, data) File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 772, in fit self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 722, in _call_and_handle_interrupt return self.strategy.launcher.launch(trainer_fn, *args, trainer=self, *kwargs) File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 93, in launch return function(args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 812, in _fit_impl results = self._run(model, ckpt_path=self.ckpt_path) File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py", line 1233, in _run self._checkpoint_connector.restore_training_state() File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/connectors/checkpoint_connector.py", line 204, in restore_training_state self.restore_optimizers_and_schedulers() File "/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/connectors/checkpoint_connector.py", line 307, in restore_optimizers_and_schedulers "Trying to restore optimizer state but checkpoint contains only the model." KeyError: 'Trying to restore optimizer state but checkpoint contains only the model. This is probably due to ModelCheckpoint.save_weights_only being set to True.'

Pure-island commented 1 year ago

the same error. Said to ollow these instructions: https://discord.com/channels/930499730843250783/953132470528798811/1018668937052962908, but I cant get access into

sALTaccount commented 1 year ago

Were you trying to train? I believe that you need the model with the optimizer states if you aren't already using it

Pure-island commented 1 year ago

Were you trying to train? I believe that you need the model with the optimizer states if you aren't already using it

thank you! it helps

CzsGit commented 1 year ago

if want to use Full Weights or official weights what should to do?