Skip to content
Snippets Groups Projects
Commit 8edf150f authored by masak1112's avatar masak1112
Browse files

runscript can find the checkpoints subfolder

parent 943018d4
No related branches found
No related tags found
No related merge requests found
Pipeline #93153 failed
...@@ -76,20 +76,28 @@ class Config_Postprocess(Config_runscript_base): ...@@ -76,20 +76,28 @@ class Config_Postprocess(Config_runscript_base):
self.model = os.path.basename(dir_base) self.model = os.path.basename(dir_base)
# List the subdirectories... # List the subdirectories...
_ = Config_Postprocess.get_subdir_list(dir_base) _ = Config_Postprocess.get_subdir_list(dir_base)
# ... and obtain the checkpoint directory
# Chose the checkpoint directory
ckp_req_str = "Chose a checkpoint directory from the list above:"
ckp_req_err = NotADirectoryError("Could not find the passed directory.")
dir_base = Config_Postprocess.keyboard_interaction(ckp_req_str, Config_Postprocess.check_dir, ckp_req_err,
prefix2arg=dir_base+"/", ntries=2)
# List the subdirectories...
_ = Config_Postprocess.get_subdir_list(dir_base)
# ... and obtain the model directory with checkpoints
trained_dir_req_str = "Choose a trained model from the experiment list above:" trained_dir_req_str = "Choose a trained model from the experiment list above:"
trained_err = FileNotFoundError("No trained model parameters found.") trained_err = FileNotFoundError("No trained model parameters found.")
self.checkpoint_dir = Config_Postprocess.keyboard_interaction(trained_dir_req_str, self.checkpoint_dir = Config_Postprocess.keyboard_interaction(trained_dir_req_str,
Config_Postprocess.check_traindir, Config_Postprocess.check_traindir,
trained_err, ntries=3, prefix2arg=dir_base+"/") trained_err, ntries=3, prefix2arg=dir_base+"/")
# get the relevant information from checkpoint_dir in order to construct source_dir and results_dir # get the relevant information from checkpoint_dir in order to construct source_dir and results_dir
# (following naming convention) # (following naming convention)
cp_dir_split = Config_Postprocess.path_rec_split(self.checkpoint_dir) cp_dir_split = Config_Postprocess.path_rec_split(self.checkpoint_dir)
cp_dir_split = list(filter(None, cp_dir_split)) # get rid of empty list elements cp_dir_split = list(filter(None, cp_dir_split)) # get rid of empty list elements
base_dir, exp_dir_base, exp_dir = "/"+os.path.join(*cp_dir_split[:-4]), cp_dir_split[-3], cp_dir_split[-1] base_dir, exp_dir_base, exp_dir = "/"+os.path.join(*cp_dir_split[:-4]), cp_dir_split[-3], cp_dir_split[-2]
self.runscript_target = self.rscrpt_tmpl_prefix + self.dataset + "_" + exp_dir + ".sh" self.runscript_target = self.rscrpt_tmpl_prefix + self.dataset + "_" + exp_dir + ".sh"
# Set results_dir # Set results_dir
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment