Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Not Found Error ? #132

Closed
AlonDan opened this issue Apr 13, 2023 · 11 comments
Closed

File Not Found Error ? #132

AlonDan opened this issue Apr 13, 2023 · 11 comments

Comments

@AlonDan
Copy link

AlonDan commented Apr 13, 2023

After I failed with the local Gradio (it works but can't generate without error)
I've tried via the prompt way.

I followed the instructions and tried the simple example, but I get this error:

(sadtalker) D:\SadTalker>python inference.py --driven_audio /_SOURCE_/1.wav  --source_image /_SOURCE_/1.png
./checkpoints\epoch_20.pth
Traceback (most recent call last):
  File "inference.py", line 158, in <module>
    main(args)
  File "inference.py", line 55, in main
    preprocess_model = CropAndExtract(path_of_lm_croper, path_of_net_recon_model, dir_of_BFM_fitting, device)
  File "D:\SadTalker\src\utils\preprocess.py", line 51, in __init__
    self.kp_extractor = KeypointExtractor(device)
  File "D:\SadTalker\src\face3d\extract_kp_videos.py", line 16, in __init__
    self.detector = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D,
  File "Z:\anaconda3\envs\sadtalker\lib\site-packages\face_alignment\api.py", line 77, in __init__
    self.face_detector = face_detector_module.FaceDetector(device=device, verbose=verbose, **face_detector_kwargs)
  File "Z:\anaconda3\envs\sadtalker\lib\site-packages\face_alignment\detection\sfd\sfd_detector.py", line 26, in __init__
    model_weights = torch.load(path_to_detector)
  File "Z:\anaconda3\envs\sadtalker\lib\site-packages\torch\serialization.py", line 699, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "Z:\anaconda3\envs\sadtalker\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "Z:\anaconda3\envs\sadtalker\lib\site-packages\torch\serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/torch/hub/checkpoints/s3fd-619a316812.pth'

@Ionaut
Copy link

Ionaut commented Apr 13, 2023

Watching this

@vinthony
Copy link
Collaborator

vinthony commented Apr 13, 2023

fixed as in #125 if you have any problem you can reopen it.

@AlonDan
Copy link
Author

AlonDan commented Apr 13, 2023

I've downloaded the latest version and tried again,
and I get this error:

./checkpoints\epoch_20.pth
./checkpoints\auido2pose_00140-model.pth
./checkpoints\auido2exp_00300-model.pth
Traceback (most recent call last):
  File "inference.py", line 158, in <module>
    main(args)
  File "inference.py", line 59, in main
    audio_to_coeff = Audio2Coeff(audio2pose_checkpoint, audio2pose_yaml_path,
  File "D:\SadTalker\src\test_audio2coeff.py", line 35, in __init__
    self.audio2pose_model = Audio2Pose(cfg_pose, wav2lip_checkpoint, device=device)
  File "D:\SadTalker\src\audio2pose_models\audio2pose.py", line 15, in __init__
    self.audio_encoder = AudioEncoder(wav2lip_checkpoint, device)
  File "D:\SadTalker\src\audio2pose_models\audio_encoder.py", line 45, in __init__
    wav2lip_state_dict = torch.load(wav2lip_checkpoint, map_location=torch.device(device))['state_dict']
  File "Z:\anaconda3\envs\SadTalker\lib\site-packages\torch\serialization.py", line 713, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "Z:\anaconda3\envs\SadTalker\lib\site-packages\torch\serialization.py", line 938, in _legacy_load
    typed_storage._storage._set_from_file(
RuntimeError: unexpected EOF, expected 1630207 more bytes. The file might be corrupted.

@vinthony
Copy link
Collaborator

where are you download from?

@vinthony vinthony reopened this Apr 14, 2023
@AlonDan
Copy link
Author

AlonDan commented Apr 14, 2023

where are you download from?

Based on these from the main page:
https://github.com/Winfredy/SadTalker#download-trained-models

I tried from Google Drive:
https://drive.google.com/drive/folders/1Wd88VDoLhVzYsQ30_qDVluQr_Xm46yHT?usp=sharing

And also from - Scrolling down to "Assets"
https://github.com/Winfredy/SadTalker/releases

I still get the same error,
Size files looks full based on the size mentioned in that list, so I don't think the files are corrupted, I also re-download and re-install on another computer just in case but I get the same exact same error.

How can I pass that error, I really want to try the local Gradio version.
I hope you can help, thanks ahead! 💙

@vinthony
Copy link
Collaborator

Sure, I will try to solve it and you can close some other similar issues by you, so we can focus on this one.

@vinthony
Copy link
Collaborator

According to the log, your wav2lip.pth file is not as unexpected. So please just try to solely download it and compare with the original file.

@vinthony
Copy link
Collaborator

it seems this issue has been solved. closed it.

@Asfandyar-Khan-2022
Copy link

I was having the exact same problem. Didn't realise you have to have a checkpoint folder within sad talker and download all the files. Extracted everything and it works now.

@romanr
Copy link

romanr commented Oct 3, 2023

Just downloaded and trying clean install, same errors:

*** Error verifying pickled file from /Users/xx/Projects/stable-diffusion-webui/extensions/SadTalker/checkpoints/auido2pose_00140-model.pth
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.
***
    Traceback (most recent call last):
      File "/Users/xx/Projects/stable-diffusion-webui/modules/safe.py", line 137, in load_with_extra
        check_pt(filename, extra_handler)
      File "/Users/xx/Projects/stable-diffusion-webui/modules/safe.py", line 83, in check_pt
        with zipfile.ZipFile(filename) as z:
      File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/zipfile.py", line 1251, in __init__
        self.fp = io.open(file, filemode)
    FileNotFoundError: [Errno 2] No such file or directory: '/Users/xx/Projects/stable-diffusion-webui/extensions/SadTalker/checkpoints/auido2pose_00140-model.pth'

---
Traceback (most recent call last):
  File "/Users/xx/Projects/stable-diffusion-webui/extensions/SadTalker/src/test_audio2coeff.py", line 48, in __init__

@notbrianbob
Copy link

idk if you guys are having the same error I had. But for me when installing SadTalker, it puts the checkpoints folder in the scripts folder inside SadTalker.

All I did was move the checkpoints folder into the SadTalker main directory rather than in scripts and it fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants