seungwonpark / melgan

MelGAN vocoder (compatible with NVIDIA/tacotron2)
http://swpark.me/melgan/
BSD 3-Clause "New" or "Revised" License
633 stars 116 forks source link

Loading without cuda results in an error #59

Open Nintorac opened 4 years ago

Nintorac commented 4 years ago

I am getting the following error while trying to load using torch hub

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

To fix apply the following snippet to this line

state_dict = torch.hub.load_state_dict_from_url(params['model_url'],
                                                        progress=progress,
                                                        map_location=torch.device('cpu'))