sp-uhh / storm

StoRM: A Diffusion-based Stochastic Regeneration Model for Speech Enhancement and Dereverberation
MIT License
164 stars 22 forks source link

Problem with inference #20

Open Vosatorp opened 2 months ago

Vosatorp commented 2 months ago
python enhancement.py --test_dir test_dir/ --enhanced_dir enhanced_dir/ --ckpt StoRM_Checkpoints/StoRM/TIMIT+Chime3/epoch\=761-pesq\=0.00.ckpt  --mode denoiser-only

/home/dsprotasov/miniconda3/envs/storm/lib/python3.8/site-packages/torch/cuda/__init__.py:145: UserWarning: 
NVIDIA A100 80GB PCIe with CUDA capability sm_80 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA A100 80GB PCIe GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
/home/dsprotasov/miniconda3/envs/storm/lib/python3.8/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Traceback (most recent call last):
  File "enhancement.py", line 56, in <module>
    model = model_cls.load_from_checkpoint(
  File "/home/dsprotasov/miniconda3/envs/storm/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 137, in load_from_checkpoint
    return _load_from_checkpoint(
  File "/home/dsprotasov/miniconda3/envs/storm/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 180, in _load_from_checkpoint
    return _load_state(cls, checkpoint, strict=strict, **kwargs)
  File "/home/dsprotasov/miniconda3/envs/storm/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 225, in _load_state
    obj = cls(**_cls_kwargs)
  File "/home/dsprotasov/xch/storm/sgmse/model.py", line 46, in __init__
    dnn_cls = BackboneRegistry.get_by_name(backbone)
  File "/home/dsprotasov/xch/storm/sgmse/util/registry.py", line 30, in get_by_name
    raise ValueError(f"{self.managed_thing} with name '{name}' unknown.")
ValueError: Backbone with name 'blade' unknown.

Does anyone know what the problem might be?

ArnabKumarRoy02 commented 3 weeks ago

The problem is that 'blade' is not registered in Registry file. The solution is to change the value of backbone to ncsnpp.

If you check in the init() of the ScoreModel class

class ScoreModel(pl.LightningModule):
    def __init__(self,
        backbone: str = "blade", sde: str = "ouvesde",
        lr: float = 1e-4, ema_decay: float = 0.999,
        t_eps: float = 3e-2, transform: str = 'none', nolog: bool = False,
        num_eval_files: int = 50, loss_type: str = 'mse', data_module_cls = None, **kwargs
    ):

Just change that value of ncsnpp. Should look like this:

class ScoreModel(pl.LightningModule):
    def __init__(self,
        backbone: str = "ncsnpp", sde: str = "ouvesde",
        lr: float = 1e-4, ema_decay: float = 0.999,
        t_eps: float = 3e-2, transform: str = 'none', nolog: bool = False,
        num_eval_files: int = 50, loss_type: str = 'mse', data_module_cls = None, **kwargs
    ):

Worked for me. Should work for you as well.

Best of luck!!