File size: 297 Bytes
5dda46f
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pathlib
import shutil

ckpt_paths = pathlib.Path("./").glob("**/model.ckpt")

for ckpt_path in ckpt_paths:
    print(ckpt_path)
    shutil.move(
        ckpt_path,
        f"{ckpt_path.parent/ ckpt_path.parent.stem}.ckpt"
    )
    print(f"{ckpt_path.parent/ ckpt_path.parent.stem}.ckpt")