bark icon indicating copy to clipboard operation
bark copied to clipboard

_pickle.UnpicklingError: invalid load key, '<'.

Open heiheiheibj opened this issue 1 year ago • 5 comments

No GPU being used. Careful, inference might be extremely slow! found outdated coarse model, removing. 100%|████████████████████████████████████████████████████████████████████████████| 4.72k/4.72k [00:00<00:00, 2.37MiB/s] Traceback (most recent call last): File "test.py", line 5, in preload_models() File "C:\bark\bark\generation.py", line 330, in preload_models _ = load_model( File "C:\bark\bark\generation.py", line 298, in load_model model = _load_model_f(ckpt_path, device) File "C:\bark\bark\generation.py", line 235, in _load_model checkpoint = torch.load(ckpt_path, map_location=device) File "C:\Python\lib\site-packages\torch\serialization.py", line 819, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Python\lib\site-packages\torch\serialization.py", line 1038, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'.

The parameter values are as follows: opened_file= <_io.BufferedReader name='C:\Users\hater\.cache\suno\bark_v0\fd2f03ce14a2cb63a27d9dc02eaecfd0.pt'> map_location= cpu pickle_module= <module 'pickle' from 'C:\Python\lib\pickle.py'> pickle_load_args= {'encoding': 'utf-8'} f= <_io.BufferedReader name='C:\Users\hater\.cache\suno\bark_v0\fd2f03ce14a2cb63a27d9dc02eaecfd0.pt'> pickle_load_args= {'encoding': 'utf-8'}

os: win 10

thankx

heiheiheibj avatar Apr 24 '23 18:04 heiheiheibj

what version of torch and what version of pickle do you have?

gkucsko avatar Apr 24 '23 21:04 gkucsko

torch 2.0.0 pickle 5 I also get an error with pickle 4.

heiheiheibj avatar Apr 25 '23 09:04 heiheiheibj

can you load the checkpoint without anything bark related or do you get the same pickle issue? torch.load("~/.cache/suno/...pt")

gkucsko avatar Apr 26 '23 01:04 gkucsko

I know what the problem is. It might be this PT file that is problematic. file size only 5k . Where can I download the correct PT file? thx

heiheiheibj avatar Apr 26 '23 06:04 heiheiheibj

it should get downloaded automatically if it's corrupt. you can also try deleting it

gkucsko avatar Apr 26 '23 13:04 gkucsko

@gkucsko I have the same error and have tried deleting the relevant .pt file to no avail. Any suggestions (@heiheiheibj did you manage to get this to work?)

csaben avatar Aug 03 '23 16:08 csaben

Hey I have got the same issue and could not find a proper solution ? Any ideas

@gkucsko I have the same error and have tried deleting the relevant .pt file to no avail. Any suggestions (@heiheiheibj did you manage to get this to work?)

Razbolt avatar Aug 14 '23 10:08 Razbolt

The downloader is referencing a file that is broken. Check your files: one of them had a 404 Page in html instead of the pickled data. I manually downloaded it from the repo and replaced the broken file

donmahallem avatar Jan 06 '24 19:01 donmahallem

The downloader is referencing a file that is broken. Check your files: one of them had a 404 Page in html instead of the pickled data. I manually downloaded it from the repo and replaced the broken file

Yes it worked, I delete the text_2.ptand redownload it. The error means that one of your .pt file is corrupted.

Thomcle avatar Apr 29 '24 18:04 Thomcle

where is the text_2.pt file usually installed? I cant find it anywhere so I can't even replace it and retest...

medfad7 avatar Aug 06 '24 19:08 medfad7