DinoMan / speech-driven-animation

949 stars 289 forks source link

Getting error #62

Closed GooDeeJAY closed 2 years ago

GooDeeJAY commented 3 years ago
Traceback (most recent call last):
  File "run.py", line 2, in <module>
    va = sda.VideoAnimator(gpu=0, model_path="crema")# Instantiate the animator
  File "C:\Users\Jasur Yusupov\AppData\Local\Programs\Python\Python38\lib\site-packages\sda\sda.py", line 109, in __init__
    model_dict = torch.load(model_path, map_location=lambda storage, loc: storage.cuda(gpu))
  File "C:\Users\Jasur Yusupov\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "C:\Users\Jasur Yusupov\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.
onzone commented 3 years ago

Same issue.. using python 3.6, windows and torch version 1.5.0

onzone commented 3 years ago

solved by placing the models in the folder "sda\data".

JasperVandeSteen commented 3 years ago

I have the same problem with Python version: 3.7.9 and Torch 1.4.0 . And models are already in the data file. Any solutions? speech-driven-animation.zip

DinoMan commented 3 years ago

Did you install the library with: pip install .

You can also try to point to the path of the model. That should work as well. va = sda.VideoAnimator(gpu=0, model_path="/path/to/crema.dat")

JasperVandeSteen commented 3 years ago

Did you install the library with: pip install .

You can also try to point to the path of the model. That should work as well. va = sda.VideoAnimator(gpu=0, model_path="/path/to/crema.dat")

Yes, I installed everything with pip install, and manualy installed torch 1.4.0 instead of the 1.7 version. Even after trying different model paths, Im either getting the same error or "FileNotFoundError: [Errno 2] No such file or directory"

DinoMan commented 3 years ago

I have not tested with this version of torch and python but I would expect it to work considering it worked for @onzone. Maybe you can try to add some lines in the library which check the path right before it loads the model (line 199 apparently).

nitesh31mishra commented 3 years ago
Traceback (most recent call last):
  File "run.py", line 2, in <module>
    va = sda.VideoAnimator(gpu=0, model_path="crema")# Instantiate the animator
  File "C:\Users\Jasur Yusupov\AppData\Local\Programs\Python\Python38\lib\site-packages\sda\sda.py", line 109, in __init__
    model_dict = torch.load(model_path, map_location=lambda storage, loc: storage.cuda(gpu))
  File "C:\Users\Jasur Yusupov\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "C:\Users\Jasur Yusupov\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

I was also facing same issue , then i checked the data folder in sda and the .dat files were present but they were not the actual model (size was 2kb ).So, i downloaded the models .dat file from the drive link and replaced in same directory. hope it works!