replace warn (#1255)

This commit is contained in:
Ftps
2023-09-19 21:15:30 +09:00
committed by GitHub
parent 1d86fb7a87
commit 36456e3908
8 changed files with 321 additions and 14 deletions

View File

@@ -113,7 +113,7 @@ class TextAudioLoaderMultiNSFsid(torch.utils.data.Dataset):
try:
spec = torch.load(spec_filename)
except:
logger.warn("%s %s", spec_filename, traceback.format_exc())
logger.warning("%s %s", spec_filename, traceback.format_exc())
spec = spectrogram_torch(
audio_norm,
self.filter_length,
@@ -305,7 +305,7 @@ class TextAudioLoader(torch.utils.data.Dataset):
try:
spec = torch.load(spec_filename)
except:
logger.warn("%s %s", spec_filename, traceback.format_exc())
logger.warning("%s %s", spec_filename, traceback.format_exc())
spec = spectrogram_torch(
audio_norm,
self.filter_length,

View File

@@ -33,7 +33,7 @@ def load_checkpoint_d(checkpoint_path, combd, sbd, optimizer=None, load_opt=1):
try:
new_state_dict[k] = saved_state_dict[k]
if saved_state_dict[k].shape != state_dict[k].shape:
logger.warn(
logger.warning(
"shape-%s-mismatch. need: %s, get: %s",
k,
state_dict[k].shape,
@@ -111,7 +111,7 @@ def load_checkpoint(checkpoint_path, model, optimizer=None, load_opt=1):
try:
new_state_dict[k] = saved_state_dict[k]
if saved_state_dict[k].shape != state_dict[k].shape:
logger.warn(
logger.warning(
"shape-%s-mismatch|need-%s|get-%s",
k,
state_dict[k].shape,
@@ -409,7 +409,7 @@ def get_hparams_from_file(config_path):
def check_git_hash(model_dir):
source_dir = os.path.dirname(os.path.realpath(__file__))
if not os.path.exists(os.path.join(source_dir, ".git")):
logger.warn(
logger.warning(
"{} is not a git repository, therefore hash value comparison will be ignored.".format(
source_dir
)
@@ -422,7 +422,7 @@ def check_git_hash(model_dir):
if os.path.exists(path):
saved_hash = open(path).read()
if saved_hash != cur_hash:
logger.warn(
logger.warning(
"git hash values are different. {}(saved) != {}(current)".format(
saved_hash[:8], cur_hash[:8]
)

View File

@@ -99,7 +99,7 @@ def main():
n_gpus = 1
if n_gpus < 1:
# patch to unblock people without gpus. there is probably a better way.
logger.warn("NO GPU DETECTED: falling back to CPU - this may take a while")
logger.warning("NO GPU DETECTED: falling back to CPU - this may take a while")
n_gpus = 1
os.environ["MASTER_ADDR"] = "localhost"
os.environ["MASTER_PORT"] = str(randint(20000, 55555))

View File

@@ -224,7 +224,7 @@ class VC:
)
except:
info = traceback.format_exc()
logger.warn(info)
logger.warning(info)
return info, (None, None)
def vc_multi(