OpenTalker / video-retalking

[SIGGRAPH Asia 2022] VideoReTalking: Audio-based Lip Synchronization for Talking Head Video Editing In the Wild
https://opentalker.github.io/video-retalking/
Apache License 2.0
6.65k stars 977 forks source link

The following error occurred when executing step six! #53

Open menkaiyuan opened 1 year ago

menkaiyuan commented 1 year ago

Traceback (most recent call last): File "D:\AIGC\videotalk\video-retalking\utils\inference_utils.py", line 118, in face_detect predictions.extend(detector.get_detections_for_batch(np.array(images[i:i + batch_size]))) File "D:\AIGC\videotalk\video-retalking\third_part\face_detection\api.py", line 66, in get_detections_for_batch detected_faces = self.face_detector.detect_from_batch(images.copy()) File "D:\AIGC\videotalk\video-retalking\third_part\face_detection\detection\sfd\sfd_detector.py", line 42, in detect_from_batch bboxlists = batch_detect(self.face_detector, images, device=self.device) File "D:\AIGC\videotalk\video-retalking\third_part\face_detection\detection\sfd\detect.py", line 69, in batch_detect olist = net(imgs) File "C:\Users\menka.conda\envs\video_retalking\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "D:\AIGC\videotalk\video-retalking\third_part\face_detection\detection\sfd\net_s3fd.py", line 71, in forward h = F.relu(self.conv1_1(x)) File "C:\Users\menka.conda\envs\video_retalking\lib\site-packages\torch\nn\functional.py", line 1298, in relu result = torch.relu(input) RuntimeError: CUDA out of memory. Tried to allocate 508.00 MiB (GPU 0; 4.00 GiB total capacity; 2.69 GiB already allocated; 0 bytes free; 3.11 GiB reserved in total by PyTorch)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "inference.py", line 342, in main() File "inference.py", line 211, in main for i, (img_batch, mel_batch, frames, coords, img_original, f_frames) in enumerate(tqdm(gen, desc='[Step 6] Lip Synthesis:', total=int(np.ceil(float(len(mel_chunks)) / args.LNet_batch_size)))): File "C:\Users\menka.conda\envs\video_retalking\lib\site-packages\tqdm\std.py", line 1178, in iter for obj in iterable: File "inference.py", line 292, in datagen face_det_results = face_detect(full_frames, args, jaw_correction=True) File "D:\AIGC\videotalk\video-retalking\utils\inference_utils.py", line 121, in face_detect raise RuntimeError('Image too big to run face detection on GPU. Please use the --resize_factor argument') RuntimeError: Image too big to run face detection on GPU. Please use the --resize_factor argument

codersun123 commented 1 year ago

RuntimeError: CUDA out of memory;you can try cpu mode or try let batchsize down

menkaiyuan commented 1 year ago

RuntimeError: CUDA out of memory;you can try cpu mode or try let batchsize down

How to enable CPU operations? Can you share the commands?