|
|
@ -18,6 +18,7 @@ import os
|
|
|
|
import random
|
|
|
|
import random
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
from contextlib import contextmanager
|
|
|
|
from contextlib import contextmanager
|
|
|
|
|
|
|
|
from pprint import pformat
|
|
|
|
from typing import List
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
import numpy as np
|
|
|
@ -41,9 +42,7 @@ def all_version():
|
|
|
|
"paddle_commit": paddle.version.commit,
|
|
|
|
"paddle_commit": paddle.version.commit,
|
|
|
|
"soundfile": soundfile.__version__,
|
|
|
|
"soundfile": soundfile.__version__,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
logger.info("Deps Module Version:")
|
|
|
|
logger.info(f"Deps Module Version:{pformat(vers.items())}")
|
|
|
|
for k, v in vers.items():
|
|
|
|
|
|
|
|
logger.info(f"{k}: {v}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@contextmanager
|
|
|
|
@contextmanager
|
|
|
@ -54,7 +53,7 @@ def UpdateConfig(config):
|
|
|
|
config.freeze()
|
|
|
|
config.freeze()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def seed_all(seed: int=210329):
|
|
|
|
def seed_all(seed: int=20210329):
|
|
|
|
"""freeze random generator seed."""
|
|
|
|
"""freeze random generator seed."""
|
|
|
|
np.random.seed(seed)
|
|
|
|
np.random.seed(seed)
|
|
|
|
random.seed(seed)
|
|
|
|
random.seed(seed)
|
|
|
@ -80,7 +79,7 @@ def print_arguments(args, info=None):
|
|
|
|
if info:
|
|
|
|
if info:
|
|
|
|
filename = info["__file__"]
|
|
|
|
filename = info["__file__"]
|
|
|
|
filename = os.path.basename(filename)
|
|
|
|
filename = os.path.basename(filename)
|
|
|
|
print(f"----------- {filename} Configuration Arguments -----------")
|
|
|
|
print(f"----------- {filename} Arguments -----------")
|
|
|
|
for arg, value in sorted(vars(args).items()):
|
|
|
|
for arg, value in sorted(vars(args).items()):
|
|
|
|
print("%s: %s" % (arg, value))
|
|
|
|
print("%s: %s" % (arg, value))
|
|
|
|
print("-----------------------------------------------------------")
|
|
|
|
print("-----------------------------------------------------------")
|
|
|
|