Turns out mac has a different memory unit

This commit is contained in:
henryruhs 2023-06-09 11:41:42 +02:00
parent 583aee95cb
commit 27a76eea60

View File

@ -95,7 +95,9 @@ def limit_resources() -> None:
for gpu in gpus:
tensorflow.config.experimental.set_memory_growth(gpu, True)
if roop.globals.max_memory:
memory = roop.globals.max_memory * 1024 * 1024 * 1024
memory = roop.globals.max_memory * 1024 ** 3
if platform.system().lower() == 'darwin':
memory = roop.globals.max_memory * 1024 ** 6
if platform.system().lower() == 'windows':
import ctypes
kernel32 = ctypes.windll.kernel32