DinoMan / speech-driven-animation

951 stars 290 forks source link

cPickle.UnpicklingError: #20

Open sunit1409 opened 5 years ago

sunit1409 commented 5 years ago

$ cat testModel.py import sda import scipy.io.wavfile as wav from PIL import Image

va = sda.VideoAnimator(gpu=0, model_path="crema")# Instantiate the animator fs, audio_clip = wav.read("example/audio.wav") still_frame = Image.open("example/image.bmp") vid, aud = va(frame, audio_clip, fs=fs) va.save_video(vid, aud, "generated.mp4")

$ python testModel.py Traceback (most recent call last): File "testModel.py", line 5, in va = sda.VideoAnimator(gpu=0, model_path="crema")# Instantiate the animator File "/home/fury/dataDump/AVATAR/speech-driven-animation/sda/sda.py", line 109, in init model_dict = torch.load(model_path, map_location=lambda storage, loc: storage.cuda(gpu)) File "/usr/local/lib/python2.7/dist-packages/torch/serialization.py", line 387, in load return _load(f, map_location, pickle_module, pickle_load_args) File "/usr/local/lib/python2.7/dist-packages/torch/serialization.py", line 564, in _load magic_number = pickle_module.load(f, pickle_load_args) cPickle.UnpicklingError: invalid load key, 'v'.

Could you please help ?

antoninklopp commented 5 years ago

Hi,

Did you clone with git lfs, since it seems that the model you are looking for is missing? instructions

By the way, your code should not be interpreted since frame does not exist, maybe try this :

import sda
va = sda.VideoAnimator(gpu=0, model_path="crema")# Instantiate the animator
vid, aud = va("example/audio.bmp", "example/audio.wav")
va.save_video(vid, aud, "generated.mp4")
ixNeo commented 4 years ago

i have tried this way, but the problem is still, what should i do then?

vuexiaob commented 4 years ago

metoo

vuexiaob commented 4 years ago

import sda va = sda.VideoAnimator(gpu=0, model_path="grid.dat")# Instantiate the animator vid, aud = va("example/girl.jpg", "example/audio.wav") va.save_video(vid, aud, "generated.mp4")

问题解决了,模型文件需要加后缀

DinoMan commented 4 years ago

Actually the model file should not need to be suffixed if you installed the library. What is likely happening is that you are running the example from the directory of the package. That means that you are using the local package rather than the one installed on the system.

himanirajora commented 3 years ago

Fixed this issue by downloading all the model files mentioned in prerequisites [https://drive.google.com/open?id=1pJdsnknLmMLvA8RQIAV3AQH8vU0FeK16] and placing them under sda/data folder Also, check the model sizes should be in MBs and not bytes