Rikorose / DeepFilterNet

Noise supression using deep filtering
https://huggingface.co/spaces/hshr/DeepFilterNet2
Other
2.4k stars 223 forks source link

Error(s) in loading state_dict for DfNet: Unexpected key(s) in state_dict: "erb_comp.c", "erb_comp.mn". #539

Closed chenCFD closed 2 months ago

chenCFD commented 6 months ago

Hi author,

Thanks for providing efficient noise reduction algorithm. I started to load model and encountered the following issues.

code:

import torch
from df.deepfilternet2 import init_model
from df.config import config

if __name__ == '__main__':

    config_file = ('config.ini')
    config.load(config_file)
    ckpt_best = torch.load('model_96.ckpt.best',map_location=torch.device('cpu'))
    model = init_model()
    model.load_state_dict(ckpt_best)
    model.to("cpu")

error:

Traceback (most recent call last): File "test_read.py", line 28, in model.load_state_dict(ckpt_best) File "/12tb/tim/pvenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2153, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for DfNet: Unexpected key(s) in state_dict: "erb_comp.c", "erb_comp.mn".

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.