fix m1/m2 user training

This commit is contained in:
RVC-Boss 2023-06-03 07:08:35 +00:00 committed by GitHub
parent 95cd1759c5
commit bf11700125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ import datetime
hps = utils.get_hparams()
os.environ["CUDA_VISIBLE_DEVICES"] = hps.gpus.replace("-", ",")
n_gpus = len(hps.gpus.split("-"))
from random import shuffle
from random import shuffle,randint
import traceback, json, argparse, itertools, math, torch, pdb
torch.backends.cudnn.deterministic = False
@ -67,9 +67,9 @@ class EpochRecorder:
def main():
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_PORT"] = "51545"
os.environ["MASTER_PORT"] = str(randint(20000,55555))
children = []
for i in range(n_gpus):
subproc = mp.Process(