Key(s) state dict errors

#2
by MaxHSl - opened

I found a problem when trying to load the .ckpt model. An unexpected keys error has appeared. I tried to load another bs roformer model and there was no error.

Here is the error log:

Start from checkpoint: D:\Program Files\Ultimate Vocal Remover\models\MDX_Net_Models\bs_roformer_fno.ckpt
Traceback (most recent call last):
File "C:\Users\User\Downloads\Music-Source-Separation-Training-main\Music-Source-Separation-Training-main\inference.py", line 157, in
proc_folder(None)
File "C:\Users\User\Downloads\Music-Source-Separation-Training-main\Music-Source-Separation-Training-main\inference.py", line 141, in proc_folder
load_start_checkpoint(args, model, type_='inference')
File "C:\Users\User\Downloads\Music-Source-Separation-Training-main\Music-Source-Separation-Training-main\model_utils.py", line 504, in load_start_checkpoint
model.load_state_dict(state_dict)
File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 2624, in load_state_dict
raise RuntimeError(
RuntimeError: Error(s) in loading state_dict for BSRoformer:
Unexpected key(s) in state_dict: "_metadata".
Process failed with return code 1

Owner

Change model.load_state_dict(state_dict) to model.load_state_dict(state_dict, strict=False)

It worked. Thanks for the help

MaxHSl changed discussion status to closed

Sign up or log in to comment