From 36683605207bc7de28ee27c634dcb641aa4bc044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phan=20Tu=E1=BA=A5n=20Anh?= Date: Mon, 5 Jun 2023 12:21:37 +0200 Subject: [PATCH] check torch gpu before clearing cache --- roop/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roop/core.py b/roop/core.py index b667a97..22113c2 100755 --- a/roop/core.py +++ b/roop/core.py @@ -209,7 +209,8 @@ def start(preview_callback = None): process_video_multi_cores(args.source_img, args.frame_paths) else: process_video(args.source_img, args.frame_paths) - torch.cuda.empty_cache() + if torch.cuda.is_available() and args.gpu_vendor in ['amd', 'nvidia']: + torch.cuda.empty_cache() status("creating video...") create_video(video_name, exact_fps, output_dir) status("adding audio...")