Skip to content

Commit

Permalink
fix bug with set_struct
Browse files Browse the repository at this point in the history
Signed-off-by: Oktai Tatanov <[email protected]>
  • Loading branch information
Oktai15 committed Feb 1, 2022
1 parent a0226ac commit 48b08b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nemo/collections/tts/models/hifigan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import torch
import torch.nn.functional as F
from hydra.utils import instantiate
from omegaconf import DictConfig, open_dict
from omegaconf import DictConfig, OmegaConf, open_dict
from pytorch_lightning.loggers.wandb import WandbLogger

from nemo.collections.tts.data.datalayers import MelAudioDataset
Expand Down Expand Up @@ -96,7 +96,10 @@ def _get_warmup_steps(self, max_steps, warmup_steps, warmup_ratio):

def configure_optimizers(self):
optim_config = self._cfg.optim.copy()

OmegaConf.set_struct(optim_config, False)
sched_config = optim_config.pop("sched", None)
OmegaConf.set_struct(optim_config, True)

optim_g = instantiate(optim_config, params=self.generator.parameters(),)
optim_d = instantiate(optim_config, params=itertools.chain(self.msd.parameters(), self.mpd.parameters()),)
Expand Down

0 comments on commit 48b08b3

Please sign in to comment.