|
@ -5,7 +5,7 @@ from pathlib import Path |
|
|
from check import make_image |
|
|
from check import make_image |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_exps(pattern: str, splitter: str = "_"): |
|
|
def get_exps(pattern: str, splitter: str = "_", dry_run: bool = True): |
|
|
basedir = "/teamspace/jobs/" |
|
|
basedir = "/teamspace/jobs/" |
|
|
chkpt_basedir = "/work/colors/lightning_logs/" |
|
|
chkpt_basedir = "/work/colors/lightning_logs/" |
|
|
location = basedir + pattern |
|
|
location = basedir + pattern |
|
@ -24,17 +24,19 @@ def get_exps(pattern: str, splitter: str = "_"): |
|
|
) |
|
|
) |
|
|
dir_path.mkdir(parents=True, exist_ok=True) |
|
|
dir_path.mkdir(parents=True, exist_ok=True) |
|
|
g = glob.glob(r + chkpt_basedir + "*") |
|
|
g = glob.glob(r + chkpt_basedir + "*") |
|
|
c = g[0] + "/checkpoints" |
|
|
|
|
|
latest_checkpoint = glob.glob(c + "/*")[-1] |
|
|
|
|
|
# print(latest_checkpoint) |
|
|
|
|
|
logs = glob.glob(g[0] + "/events*")[-1] |
|
|
logs = glob.glob(g[0] + "/events*")[-1] |
|
|
print(logs) |
|
|
|
|
|
source_path = Path(logs) |
|
|
source_path = Path(logs) |
|
|
print("Would copy", source_path, dir_path) |
|
|
print(logs) |
|
|
# shutil.copy(source_path, dir_path) |
|
|
if not dry_run: |
|
|
# make_image(latest_checkpoint, f"out/version_{i}") |
|
|
c = g[0] + "/checkpoints" |
|
|
|
|
|
latest_checkpoint = glob.glob(c + "/*")[-1] |
|
|
|
|
|
print(latest_checkpoint) |
|
|
|
|
|
if not dry_run: |
|
|
|
|
|
shutil.copy(source_path, dir_path) |
|
|
|
|
|
make_image(latest_checkpoint, f"out/version_{i}") |
|
|
# make_image(latest_checkpoint, f"out/version_{i}b", color=False) |
|
|
# make_image(latest_checkpoint, f"out/version_{i}b", color=False) |
|
|
|
|
|
else: |
|
|
|
|
|
print("Would copy", source_path, dir_path) |
|
|
return H |
|
|
return H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|