mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-02-01 03:02:54 +08:00
fix m1/m2 user training
This commit is contained in:
parent
95cd1759c5
commit
bf11700125
@ -9,7 +9,7 @@ import datetime
|
|||||||
hps = utils.get_hparams()
|
hps = utils.get_hparams()
|
||||||
os.environ["CUDA_VISIBLE_DEVICES"] = hps.gpus.replace("-", ",")
|
os.environ["CUDA_VISIBLE_DEVICES"] = hps.gpus.replace("-", ",")
|
||||||
n_gpus = len(hps.gpus.split("-"))
|
n_gpus = len(hps.gpus.split("-"))
|
||||||
from random import shuffle
|
from random import shuffle,randint
|
||||||
import traceback, json, argparse, itertools, math, torch, pdb
|
import traceback, json, argparse, itertools, math, torch, pdb
|
||||||
|
|
||||||
torch.backends.cudnn.deterministic = False
|
torch.backends.cudnn.deterministic = False
|
||||||
@ -67,9 +67,9 @@ class EpochRecorder:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
n_gpus = torch.cuda.device_count()
|
n_gpus = torch.cuda.device_count()
|
||||||
|
if torch.cuda.is_available()==False and torch.backends.mps.is_available()==True:n_gpus = 1
|
||||||
os.environ["MASTER_ADDR"] = "localhost"
|
os.environ["MASTER_ADDR"] = "localhost"
|
||||||
os.environ["MASTER_PORT"] = "51545"
|
os.environ["MASTER_PORT"] = str(randint(20000,55555))
|
||||||
|
|
||||||
children = []
|
children = []
|
||||||
for i in range(n_gpus):
|
for i in range(n_gpus):
|
||||||
subproc = mp.Process(
|
subproc = mp.Process(
|
||||||
|
Loading…
Reference in New Issue
Block a user