From 54adcc0fc6a2103c61f7fac189b49e78b575c490 Mon Sep 17 00:00:00 2001 From: Tran Xen <137925069+glucauze@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:54:57 +0200 Subject: [PATCH] fix install --- install.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.py b/install.py index 6b9523a..3cd5a10 100644 --- a/install.py +++ b/install.py @@ -2,12 +2,18 @@ import os import sys import pkg_resources -from modules import shared from packaging.version import parse def check_install() -> None: - use_gpu = not getattr(shared.cmd_opts, "use-cpu", False) + use_gpu = True + try: + from modules import shared + + use_gpu = not getattr(shared.cmd_opts, "use-cpu", False) + except: + # On some platform previous lines may failed (modules.shared not initialized), just ignore and use GPU requirements + pass if use_gpu and sys.platform != "darwin": print("Faceswaplab : Use GPU requirements")