diff --git a/dpgen/generator/run.py b/dpgen/generator/run.py index 8f6265a3d..81a105b64 100644 --- a/dpgen/generator/run.py +++ b/dpgen/generator/run.py @@ -272,8 +272,7 @@ def make_train_dp(iter_index, jdata, mdata): # train_param = jdata['train_param'] train_input_file = default_train_input_file numb_models = jdata["numb_models"] - init_data_prefix = jdata["init_data_prefix"] - init_data_prefix = os.path.abspath(init_data_prefix) + init_data_prefix = os.path.abspath(jdata["init_data_prefix"]) init_data_sys_ = jdata["init_data_sys"] fp_task_min = jdata["fp_task_min"] model_devi_jobs = jdata["model_devi_jobs"] @@ -390,14 +389,17 @@ def make_train_dp(iter_index, jdata, mdata): sys_paths = expand_sys_str(os.path.join(init_data_prefix, ii)) for single_sys in sys_paths: init_data_sys.append( - os.path.normpath( - os.path.join( - "..", - "data.init", - ii, - os.path.relpath(single_sys, os.path.join(init_data_prefix, ii)), + Path( + os.path.normpath( + os.path.join( + "../data.init", + ii, + os.path.relpath( + single_sys, os.path.join(init_data_prefix, ii) + ), + ) ) - ) + ).as_posix() ) init_batch_size.append(detect_batch_size(ss, single_sys)) if auto_ratio: @@ -435,7 +437,9 @@ def make_train_dp(iter_index, jdata, mdata): continue for sys_single in sys_paths: init_data_sys.append( - os.path.normpath(os.path.join("..", "data.iters", sys_single)) + Path( + os.path.normpath(os.path.join("../data.iters", sys_single)) + ).as_posix() ) batch_size = ( sys_batch_size[sys_idx] @@ -763,8 +767,6 @@ def run_train_dp(iter_index, jdata, mdata): if suffix == ".pth": train_command += " --pt" - train_resources = mdata["train_resources"] - # paths iter_name = make_iter_name(iter_index) work_path = os.path.join(iter_name, train_name) @@ -1558,7 +1560,7 @@ def _make_model_devi_native(iter_index, jdata, mdata, conf_systems): models = sorted(glob.glob(os.path.join(train_path, f"graph*{suffix}"))) task_model_list = [] for ii in models: - task_model_list.append(os.path.join("..", os.path.basename(ii))) + task_model_list.append(Path(f"../{Path(ii).name}").as_posix()) work_path = os.path.join(iter_name, model_devi_name) sys_counter = 0