From a83594a29b480b56a599058c9de8b15464acd680 Mon Sep 17 00:00:00 2001 From: Michael <m.langguth@fz-juelich.de> Date: Mon, 25 Jul 2022 14:24:44 +0200 Subject: [PATCH] Some corrections to config_postprocess.py. --- .../utils/runscript_generator/config_postprocess.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/video_prediction_tools/utils/runscript_generator/config_postprocess.py b/video_prediction_tools/utils/runscript_generator/config_postprocess.py index 5edf0030..9e33f961 100755 --- a/video_prediction_tools/utils/runscript_generator/config_postprocess.py +++ b/video_prediction_tools/utils/runscript_generator/config_postprocess.py @@ -60,7 +60,7 @@ class Config_Postprocess(Config_runscript_base): # get the 'checkpoint-directory', i.e. the directory where the trained model parameters are stored # Note that the remaining information (model, results-directory etc.) can be retrieved form it!!! - # First chosse the basic experiment directory + # First choose the basic experiment directory dir_base = Config_Postprocess.handle_source_dir(self, "models") expbase_req_str = "Choose an experiment from the list above:" expbase_err = NotADirectoryError("Could not find passed directory.") @@ -101,7 +101,7 @@ class Config_Postprocess(Config_runscript_base): self.runscript_target = self.rscrpt_tmpl_prefix + self.dataset + "_" + exp_dir + ".sh" # Set results_dir - self.results_dir = os.path.join(base_dir, "results", exp_dir_base,self.model, exp_dir) + self.results_dir = os.path.join(base_dir, "results", exp_dir_base, self.model, exp_dir) return # Decide if quick evaluation should be performed @@ -150,9 +150,11 @@ class Config_Postprocess(Config_runscript_base): :param silent: flag if print-statement are executed :return: status with True confirming success """ + status = False if not os.path.isdir(dir_in): if not silent: print("{0} is not a directory".format(dir_in)) - status = False + elif dir_in == "": + if not silent: print("{0}: Please enter a directory/checkpoint.") else: status = True @@ -184,7 +186,7 @@ class Config_Postprocess(Config_runscript_base): print("The base directory does not exist as well!") return status - if not model_in: # user just printed 'Enter' + if not model_in: # user just pressed 'Enter' _ = Config_Postprocess.get_subdir_list(os.path.dirname(model_path)) return status -- GitLab