Found by Codex global repository scan of deepmodeling/dpgen2 at commit 2679611a3704f5c2646c8cb353e34177518db758.
PrepCalyDPOptim first looks for TensorFlow frozen models and symlinks the selected model under that filename:
|
group_size = ip["template_slice_config"].get("group_size", len(poscar_list)) |
|
|
|
model_name = "frozen_model.pb" |
|
model_list = [model.resolve() for model in models_dir.rglob(model_name)] |
|
if len(model_list) == 0: |
|
model_name = "model.ckpt.pt" |
|
model_list = [model.resolve() for model in models_dir.rglob(model_name)] |
|
model_list = sorted(model_list, key=lambda x: str(x).split(".")[1]) |
|
model_file = model_list[0] |
|
with set_directory(opt_path): |
|
for poscar in _poscar_list: |
|
Path(poscar.name).symlink_to(poscar) |
|
Path(model_name).symlink_to(model_file) |
|
Path(caly_run_opt_file.name).symlink_to(caly_run_opt_file) |
But RunCalyDPOptim defaults to a PyTorch checkpoint filename:
|
config = ip["config"] if ip["config"] is not None else {} |
|
command = config.get( |
|
"run_opt_command", "python -u calypso_run_opt.py model.ckpt.pt" |
|
) |
|
|
|
work_dir = Path(ip["task_name"]) |
|
|
|
with set_directory(work_dir): |
|
# link input files |
|
for ii in input_files: |
|
iname = ii.name |
|
Path(iname).symlink_to(ii) |
|
|
|
if finished == "false": |
|
ret, out, err = run_command(command, shell=True) |
For the default TensorFlow path, the task directory contains frozen_model.pb, while the default command tries to load model.ckpt.pt. The optimization step fails unless users manually override run_opt_command.
Suggested fix: make the default command match the model file that PrepCalyDPOptim symlinks, or pass the selected model filename explicitly into the generated command.
Found by Codex global repository scan of
deepmodeling/dpgen2at commit2679611a3704f5c2646c8cb353e34177518db758.PrepCalyDPOptimfirst looks for TensorFlow frozen models and symlinks the selected model under that filename:dpgen2/dpgen2/op/prep_caly_dp_optim.py
Lines 121 to 129 in 2679611
dpgen2/dpgen2/op/prep_caly_dp_optim.py
Lines 144 to 148 in 2679611
But
RunCalyDPOptimdefaults to a PyTorch checkpoint filename:dpgen2/dpgen2/op/run_caly_dp_optim.py
Lines 103 to 117 in 2679611
For the default TensorFlow path, the task directory contains
frozen_model.pb, while the default command tries to loadmodel.ckpt.pt. The optimization step fails unless users manually overriderun_opt_command.Suggested fix: make the default command match the model file that
PrepCalyDPOptimsymlinks, or pass the selected model filename explicitly into the generated command.