RVC-GUI / main /app /run_tensorboard.py
Last commit not found
raw
history blame
829 Bytes
import os
import sys
import json
import logging
import webbrowser
from tensorboard import program
sys.path.append(os.getcwd())
from main.configs.config import Config
translations = Config().translations
with open(os.path.join("main", "configs", "config.json"), "r") as f:
configs = json.load(f)
def launch_tensorboard_pipeline():
logging.getLogger("root").setLevel(logging.ERROR)
logging.getLogger("tensorboard").setLevel(logging.ERROR)
tb = program.TensorBoard()
tb.configure(argv=[None, "--logdir", "assets/logs", f"--port={configs["tensorboard_port"]}"])
url = tb.launch()
print(f"{translations['tensorboard_url']}: {url}")
webbrowser.open(url)
return f"{translations['tensorboard_url']}: {url}"
if __name__ == "__main__": launch_tensorboard_pipeline()