remote-task-excutor-cli/merge_aim.py

22 lines
719 B
Python

from aim import Repo,Run
import os
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="合并aim仓库")
parser.add_argument("--repo_path", default="", help="train epochs", type=str)
args = parser.parse_args()
# 打开本地 repo
local_repo = Repo(args.repo_path)
aim_server=os.getenv('EXPERIMENT_REMOTE_REPO')
remote_repo = Repo(path=aim_server) # 确保远程 server 开启 tracking
for run_hash in local_repo.list_all_runs():
run = Run(run_hash=run_hash, repo=local_repo, read_only=False)
run['id'] = os.getenv('EXPERIMENT_RUN_ID')
run.close()
local_repo.copy_runs(local_repo.list_all_runs(),remote_repo)