Views
No views yet
TCGA or IMPACT)HNSC, UCS, BRCA)PIK3CA, FBXW7, BRAF)virchow, gigapath_ft)split_1, split_2, ...)1TCGA_Genomic_Biomarker_WSI_Training/
2├── TCGA/
3│ └── checkpoints/
4│ └── <TUMOR>/
5│ └── <GENE>/
6│ └── TCGA_trained_<TUMOR>_<GENE>_<ENCODER>_gma_<SPLIT>_200.pth
7│
8└── IMPACT/
9 └── checkpoints/
10 └── <TUMOR>/
11 └── <GENE>/
12 └── IMPACT_trained_<TUMOR>_<GENE>_<ENCODER>_gma_<SPLIT>_200.pth1TCGA/checkpoints/HNSC/PIK3CA/
2 TCGA_trained_HNSC_PIK3CA_virchow_gma_1_200.pth
3 TCGA_trained_HNSC_PIK3CA_virchow_gma_2_200.pth
4 TCGA_trained_HNSC_PIK3CA_gigapath_ft_gma_1_200.pth
5
6IMPACT/checkpoints/UCS/FBXW7/
7 IMPACT_trained_UCS_FBXW7_virchow_gma_1_200.pth
8 IMPACT_trained_UCS_FBXW7_gigapath_ft_gma_2_200.pth<SOURCE>_trained_<TUMOR>_<GENE>_<ENCODER>_gma_<SPLIT>_200.pth1git lfs install
2git clone https://huggingface.co/chadvanderbilt/TCGA_Genomic_Biomarker_WSI_Training
3cd TCGA_Genomic_Biomarker_WSI_Training1from huggingface_hub import hf_hub_download
2
3ckpt_path = hf_hub_download(
4 repo_id="chadvanderbilt/TCGA_Genomic_Biomarker_WSI_Training",
5 filename="TCGA/checkpoints/HNSC/PIK3CA/TCGA_trained_HNSC_PIK3CA_virchow_gma_1_200.pth"
6)
7print(ckpt_path)logs/checkpoint_checksums_YYYYMMDD_HHMMSS.jsonsource (TCGA or IMPACT)tumorgeneencodersplitremote_path (path inside this repo)size_bytessha256timestampverify_checkpoints.py for checksum verification.python verify_checkpoints.py logs/checkpoint_checksums_YYYYMMDD_HHMMSS.jsonremote_path under the repo root.sha256 and size_bytes.1OK : 128
2MISMATCH : 0
3MISSING : 0verify_checkpoints.pyverify_checkpoints.py is:1import json, hashlib, sys
2from pathlib import Path
3
4def sha256_file(path, buf=1024*1024):
5 h = hashlib.sha256()
6 with open(path, "rb") as f:
7 while True:
8 chunk = f.read(buf)
9 if not chunk:
10 break
11 h.update(chunk)
12 return h.hexdigest()
13
14def main(log_json: str):
15 log_file = Path(log_json)
16 if not log_file.is_file():
17 print(f"ERROR: log not found: {log_json}")
18 sys.exit(1)
19
20 with log_file.open() as f:
21 records = json.load(f)
22
23 repo_root = Path(__file__).resolve().parent
24
25 ok = mismatch = missing = 0
26
27 for rec in records:
28 remote_path = rec["remote_path"]
29 expected_sha = rec["sha256"]
30 expected_size = rec["size_bytes"]
31
32 local_path = repo_root / remote_path
33
34 if not local_path.exists():
35 print(f"[MISSING] {remote_path}")
36 missing += 1
37 continue
38
39 actual_size = local_path.stat().st_size
40 actual_sha = sha256_file(local_path)
41
42 if actual_sha == expected_sha and actual_size == expected_size:
43 ok += 1
44 else:
45 mismatch += 1
46 print(f"[MISMATCH] {remote_path}")
47 print(f" expected sha : {expected_sha}")
48 print(f" actual sha : {actual_sha}")
49 print(f" expected size: {expected_size}")
50 print(f" actual size : {actual_size}")
51
52 print()
53 print(f"OK : {ok}")
54 print(f"MISMATCH : {mismatch}")
55 print(f"MISSING : {missing}")
56
57 if mismatch or missing:
58 sys.exit(1)
59
60if __name__ == "__main__":
61 if len(sys.argv) != 2:
62 print("Usage: python verify_checkpoints.py logs/checkpoint_checksums_YYYYMMDD_HHMMSS.json")
63 sys.exit(1)
64 main(sys.argv[1])