EveryVoiceTTS / EveryVoice

The EveryVoice TTS Toolkit - Text To Speech for your language
https://docs.everyvoice.ca
Other
20 stars 2 forks source link

AttributeError: 'torch.device' object has no attribute 'types' #261

Closed SamuelLarkin closed 7 months ago

SamuelLarkin commented 7 months ago

@marctessier while trying to use a vocooder_path stumbled on this error message:

│ /home/sam037/.conda/envs/EveryVoice.sl/lib/python3.11/site-packages/pytorch_lightning/strategies │
│ /strategy.py:626 in wrapped_forward                                                              │
│                                                                                                  │
│   623 │   │   │   original_module.forward = original_forward  # type: ignore[method-assign]      │
│   624 │   │   │   # Call the actual method e.g. `.training_step(...)`                            │
│   625 │   │   │   method = getattr(original_module, method_name)                                 │
│ ❱ 626 │   │   │   out = method(*_args, **_kwargs)                                                │
│   627 │   │   │   self.on_after_inner_forward(wrapper_module, original_module)                   │
│   628 │   │   │   return out                                                                     │
│   629                                                                                            │
│                                                                                                  │
│ /fs/hestia_Hnrc/ict/sam037/git/EveryVoice/everyvoice/model/feature_prediction/FastSpeech2_lightn │
│ ing/fs2/model.py:279 in validation_step                                                          │
│                                                                                                  │
│   276 │   │   │   │   │   │   self.config.training.vocoder_path,                                 │
│   277 │   │   │   │   │   │   map_location=batch["mel"].device,                                  │
│   278 │   │   │   │   │   )                                                                      │
│ ❱ 279 │   │   │   │   │   gt_wav, gt_sr = synthesize_data(batch["mel"], checkpoint)              │
│   280 │   │   │   │   self.logger.experiment.add_audio(                                          │
│   281 │   │   │   │   │   f"copy-synthesis/wav_{batch['basename'][0]}",                          │
│   282 │   │   │   │   │   gt_wav,                                                                │
│                                                                                                  │
│ /fs/hestia_Hnrc/ict/sam037/git/EveryVoice/everyvoice/model/vocoder/HiFiGAN_iSTFT_lightning/hfgl/ │
│ utils.py:40 in synthesize_data                                                                   │
│                                                                                                  │
│   37 │   │   with torch.no_grad():                                                               │
│   38 │   │   │   mag, phase = model.generator(data.transpose(1, 2))                              │
│   39 │   │   # We can remove this once the fix for https://github.com/pytorch/pytorch/issues/    │
│ ❱ 40 │   │   if mag.device.types == "mps" or phase.device.type == "mps":                         │
│   41 │   │   │   logger.warning(                                                                 │
│   42 │   │   │   │   "Handling complex numbers is broken on MPS (last checked in torch==2.2.0    │
│   43 │   │   │   )                                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'torch.device' object has no attribute 'types'
Loading EveryVoice modules: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:25<00:00,  6.26s/it]
roedoejet commented 7 months ago

Oops, this a typo from me. Sorry. Should be .type and not .types

SamuelLarkin commented 7 months ago

I'm already taking care of this 😄 I wanted an issue to have my PR associated with something.