SadTalker icon indicating copy to clipboard operation
SadTalker copied to clipboard

I encountered a problem at runtime: AttributeError: _2D, how can I solve it?

Open LGDJCY opened this issue 1 year ago • 6 comments

The full problem is described below:

Traceback (most recent call last): File "inference.py", line 158, in 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 "G:\aaa_jcy\SadTalker\src\utils\preprocess.py", line 46, in init self.kp_extractor = KeypointExtractor(device) File "G:\aaa_jcy\SadTalker\src\face3d\extract_kp_videos.py", line 16, in init self.detector = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device=device) File "F:\Program_Files\Anaconda\envs\sadtalker\lib\enum.py", line 384, in getattr raise AttributeError(name) from None AttributeError: _2D

LGDJCY avatar Aug 31 '23 07:08 LGDJCY

@LGDJCY Go to File "/Users/yangboz/git/SadTalker/src/face3d/extract_kp_videos.py", line 16, in init and change face_alignment.LandmarksType._2D to face_alignment.LandmarksType.TWO_D

zero-or-one avatar Sep 04 '23 13:09 zero-or-one

You could also try pip install face-alignment==1.3.4

Apparently the ._2D and ._3D (which was what I had in my case) attributes are not compatible with face-alignment>1.3.4.

mayowaosibodu avatar Sep 05 '23 00:09 mayowaosibodu

You could also try pip install face-alignment==1.3.4

Apparently the ._2D and ._3D (which was what I had in my case) attributes are not compatible with face-alignment>1.3.4.

OK,thankyou!

LGDJCY avatar Sep 05 '23 07:09 LGDJCY

@LGDJCY Go to File "/Users/yangboz/git/SadTalker/src/face3d/extract_kp_videos.py", line 16, in init and change face_alignment.LandmarksType._2D to face_alignment.LandmarksType.TWO_D

I see. Thank you!

LGDJCY avatar Sep 05 '23 07:09 LGDJCY

You could also try pip install face-alignment==1.3.4

Apparently the ._2D and ._3D (which was what I had in my case) attributes are not compatible with face-alignment>1.3.4.

it gets solved, but another problem comes out.

(base) root@iZf8zejm0dnzfmwm21d3e2Z:~/Projects/SadTalker-Video-Lip-Sync# python inference.py --driven_audio /examples/driven_audio/chinese_poem1.wav --source_video /examples/driven_vedio/1.mp4 ./checkpoints/epoch_20.pth ./checkpoints/auido2pose_00140-model.pth ./checkpoints/auido2exp_00300-model.pth ./checkpoints/facevid2vid_00189-model.pth.tar ./checkpoints/mapping_00109-model.pth.tar Killed

I don't know how to deal with it.

icomefrom avatar Mar 20 '24 14:03 icomefrom

change _2D -> TWO_D / _3D -> THREE_D

manhdan226 avatar May 19 '24 15:05 manhdan226