TMElyralab / MuseTalk

MuseTalk: Real-Time High Quality Lip Synchorization with Latent Space Inpainting
Other
2.51k stars 308 forks source link

Cannot import MuseTalk module for custom nodes: unexpected EOF, expected 15021382 more bytes. The file might be corrupted. #77

Closed greengerong closed 4 months ago

greengerong commented 4 months ago

代码

        # Get the face detector
        face_detector_module = __import__('face_detection.detection.' + face_detector,
                                          globals(), locals(), [face_detector], 0)

        self.face_detector = face_detector_module.FaceDetector(device=device, verbose=verbose)

这行本地运行报错:

File "/ComfyUI-MuseTalk/nodes.py", line 26, in <module>
    from musetalk.utils.preprocessing import get_landmark_and_bbox,read_imgs,coord_placeholder
  File "/ComfyUI-MuseTalk/musetalk/utils/preprocessing.py", line 32, in <module>
    fa = FaceAlignment(LandmarksType._2D, flip_input=False,device=device)
  File "/ComfyUI-MuseTalk/musetalk/utils/face_detection/api.py", line 69, in __init__
    self.face_detector = face_detector_module.FaceDetector(device=device, verbose=verbose)
  File "/ComfyUI-MuseTalk/musetalk/utils/face_detection/detection/sfd/sfd_detector.py", line 22, in __init__
    model_weights = load_url(models_urls['s3fd'])
  File "/home/greengerong/anaconda3/envs/aiimage/lib/python3.10/site-packages/torch/hub.py", line 764, in load_state_dict_from_url
    return torch.load(cached_file, map_location=map_location, weights_only=weights_only)
  File "/home/greengerong/anaconda3/envs/aiimage/lib/python3.10/site-packages/torch/serialization.py", line 1040, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/greengerong/anaconda3/envs/aiimage/lib/python3.10/site-packages/torch/serialization.py", line 1281, in _legacy_load
    typed_storage._untyped_storage._set_from_file(
RuntimeError: unexpected EOF, expected 15021382 more bytes. The file might be corrupted.

Cannot import MuseTalk module for custom nodes: unexpected EOF, expected 15021382 more bytes. The file might be corrupted.

对应文件79999_iter.pth重复确认下载。 请问如何解决?

greengerong commented 4 months ago

手动下载s3fd解决。

yixian3500 commented 4 months ago

我也出现同样的问题,请问s3fd是从huggingface哪个项目里下载的?

yixian3500 commented 4 months ago

我也出现同样的问题,请问s3fd是从huggingface哪个项目里下载的?

found it here :https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth

yuutong commented 3 months ago

我也遇到了相似的错误,但是即便将s3fd是从huggingface下载到本地,用绝对路径去引用,也会再报相同的错误, 请问跟用CPU去运行还是用GPU去运行有关系吗?我用的是CPU,以下是我的错误报告: (musetalk_t) F:\Project\MuseTalk> python -m scripts.inference --inference_config configs/inference/test.yaml add ffmpeg to path Loads checkpoint by local backend from path: ./models/dwpose/dw-ll_ucoco_384.pth I try to load s3fd_start!!!!!!!!!!!!!!!!!! Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "F:\Project\MuseTalk\scripts\inference.py", line 13, in from musetalk.utils.preprocessing import get_landmark_and_bbox,read_imgs,coord_placeholder File "F:\Project\MuseTalk\musetalk\utils\preprocessing.py", line 23, in fa = FaceAlignment(LandmarksType._2D, flip_input=False,device=device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\Project\MuseTalk\musetalk/utils\face_detection\api.py", line 69, in init self.face_detector = face_detector_module.FaceDetector(device=device, verbose=verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\Project\MuseTalk\musetalk/utils\face_detection\detection\sfd\sfd_detector.py", line 24, in init__ model_weights = load_url(models_urls['s3fd']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\software\Anaconda\envs\musetalk_t\Lib\site-packages\torch\hub.py", line 750, in load_state_dict_from_url return torch.load(cached_file, map_location=map_location) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\software\Anaconda\envs\musetalk_t\Lib\site-packages\torch\serialization.py", line 815, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\software\Anaconda\envs\musetalk_t\Lib\site-packages\torch\serialization.py", line 1051, in _legacy_load typed_storage._untyped_storage._set_from_file( RuntimeError: unexpected EOF, expected 128918 more bytes. The file might be corrupted.