| """ |
| 独立 launcher — 运行后关闭父进程,子进程继续运行。 |
| 在远程执行: F:\f\pyopenfoam-gpu\python.exe Code\scripts\detached_train.py |
| """ |
| import subprocess |
| import os |
| import sys |
|
|
| os.chdir(r"F:\agent-workspace\paper2") |
| os.environ["PYTHONUNBUFFERED"] = "1" |
|
|
| log_path = r"Exp\results\R1\train_log.txt" |
|
|
| |
| flags = 0x00000200 | 0x00000008 |
|
|
| with open(log_path, "w") as log: |
| proc = subprocess.Popen( |
| [ |
| r"F:\f\pyopenfoam-gpu\python.exe", "-u", |
| r"Code\scripts\resolution_generalization.py", |
| "--checkpoint_root", "checkpoints", |
| "--output_dir", r"Exp\results\R1", |
| "--train_resolutions", "64", "256", |
| "--skip_generalization", |
| "--n_rollout_steps", "50", |
| "--epochs_s1", "50", |
| "--epochs_s2", "30", |
| "--seed", "42", |
| "--device", "cuda", |
| ], |
| stdout=log, |
| stderr=subprocess.STDOUT, |
| creationflags=flags, |
| ) |
|
|
| print(f"PID={proc.pid}", flush=True) |
| |
|
|