r9y9 / deepvoice3_pytorch

PyTorch implementation of convolutional neural networks-based text-to-speech synthesis models
https://r9y9.github.io/deepvoice3_pytorch/
Other
1.97k stars 485 forks source link

Error while loading the model #219

Open Parvez2017 opened 3 years ago

Parvez2017 commented 3 years ago

When I tried to do synthesis with a saved checkpoint, it gives pickle error. I tried on stackoverflow and pytorch forum, but could not get any help.

some similar issues were https://stackoverflow.com/questions/63063723/how-to-fix-pickle-module-loadf-pickle-load-args-pickle-unpicklingerror-i https://discuss.pytorch.org/t/trying-to-load-a-model-in-pytorch-1-6-results-in-pickle-unpicklingerror-invalid-load-key-xad/95615


  File "synthesis.py", line 126, in <module>
    checkpoint = _load(checkpoint_path)
  File "synthesis.py", line 78, in _load
    checkpoint = torch.load(checkpoint_path)
  File "C:\Users\LENOVO\deepfake-voice\env\lib\site-packages\torch\serialization.py", line 593, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "C:\Users\LENOVO\deepfake-voice\env\lib\site-packages\torch\serialization.py", line 762, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'f'.
AIKalix commented 3 years ago

I got a similar error. When I tried to synthesis and vocode with Spanish, It gives pickle and EOFError.

Trainable Parameters: 30.870M Traceback (most recent call last): File "/Users/ryuma/Desktop/Graduation_Study/Real-Time-Voice-Cloning-master/toolbox/init.py", line 129, in func = lambda: self.translate() or self.vocode() File "/Users/ryuma/Desktop/Graduation_Study/Real-Time-Voice-Cloning-master/toolbox/init.py", line 413, in translate specs = self.synthesizer.synthesize_spectrograms(texts, embeds) File "/Users/ryuma/Desktop/Graduation_Study/Real-Time-Voice-Cloning-master/synthesizer/inference.py", line 86, in synthesize_spectrograms self.load() File "/Users/ryuma/Desktop/Graduation_Study/Real-Time-Voice-Cloning-master/synthesizer/inference.py", line 64, in load self._model.load(self.model_fpath) File "/Users/ryuma/Desktop/Graduation_Study/Real-Time-Voice-Cloning-master/synthesizer/models/tacotron.py", line 496, in load checkpoint = torch.load(str(path), map_location=device) File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/usr/local/lib/python3.8/site-packages/torch/serialization.py", line 764, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) EOFError: Ran out of input