Voice-Cloning-App icon indicating copy to clipboard operation
Voice-Cloning-App copied to clipboard

UnpicklingError: invalid load key, '<'.

Open SentinalMax opened this issue 1 year ago • 2 comments

I've insured my metadata.csv file is UTF-8 encoded without BOM since that's what these ML algorithms seem to like. Here's my error:

INFO:root:Setting batch size to 38, learning rate to 0.0003082207001484488. (14GB GPU memory free)
INFO:root:Loading model...
INFO:root:Loaded model
INFO:root:Loading data...
79 train files, 20 test files
/content/Voice-Cloning-App/training/tacotron2_model/stft.py:69: FutureWarning: Pass size=1024 as keyword args. From version 0.10 passing these as positional arguments will result in an error
  fft_window = pad_center(fft_window, filter_length)
/content/Voice-Cloning-App/training/tacotron2_model/stft.py:159: FutureWarning: Pass sr=22050, n_fft=1024, n_mels=80, fmin=0.0, fmax=8000.0 as keyword args. From version 0.10 passing these as positional arguments will result in an error
  mel_basis = librosa_mel_fn(sampling_rate, filter_length, n_mel_channels, mel_fmin, mel_fmax)
INFO:root:Loaded data
---------------------------------------------------------------------------
UnpicklingError                           Traceback (most recent call last)
[<ipython-input-5-9bb687479d52>](https://localhost:8080/#) in <cell line: 9>()
      7 symbols = load_symbols(os.path.join(alphabet_directory, alphabet.value)) if alphabet.value else DEFAULT_ALPHABET
      8 checkpoint_path = os.path.join(checkpoint_directory, dataset.value, checkpoint.value) if checkpoint.value else None
----> 9 train(
     10     metadata_path=metadata,
     11     dataset_directory=wavs,

3 frames
[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
   1031             "functionality.")
   1032 
-> 1033     magic_number = pickle_module.load(f, **pickle_load_args)
   1034     if magic_number != MAGIC_NUMBER:
   1035         raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '<'.

I have everything in seemingly the right position, accessible by remote collab. Any help would be appreciated thank you.

SentinalMax avatar Sep 07 '23 19:09 SentinalMax

The problem is Google Drive is bad and everyone who had anything to do with making it the mess that it is should feel bad.

This line is returning Google Drive's virus scan HTML, rather than a file:

gdd.download_file_from_google_drive(file_id='1c5ZTuT7J08wLUoVZ2KkUs_VdZuJ86ZqA', dest_path="./"+transfer_learning_path, unzip=False)

see:

! file pretrained.pt ! cat pretrained.pt

Get the file from here:

https://drive.usercontent.google.com/download?id=1c5ZTuT7J08wLUoVZ2KkUs_VdZuJ86ZqA

rename it to pretrained.pt, put it in your Voice-Cloning dir and add this after the config step:

! cp /content/drive/MyDrive/Voice-Cloning/pretrained.pt /Voice-Cloning/

bitplane avatar Sep 15 '23 10:09 bitplane

https://colab.research.google.com/gist/bitplane/60543855a8fc3df473e94e18d45b06a3/copy-of-voice-cloning-training.ipynb

bitplane avatar Sep 15 '23 10:09 bitplane