Skip to content
Snippets Groups Projects
Commit a83594a2 authored by Michael Langguth's avatar Michael Langguth
Browse files

Some corrections to config_postprocess.py.

parent 432fcc72
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ class Config_Postprocess(Config_runscript_base): ...@@ -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 # 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!!! # 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") dir_base = Config_Postprocess.handle_source_dir(self, "models")
expbase_req_str = "Choose an experiment from the list above:" expbase_req_str = "Choose an experiment from the list above:"
expbase_err = NotADirectoryError("Could not find passed directory.") expbase_err = NotADirectoryError("Could not find passed directory.")
...@@ -101,7 +101,7 @@ class Config_Postprocess(Config_runscript_base): ...@@ -101,7 +101,7 @@ class Config_Postprocess(Config_runscript_base):
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
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 return
# Decide if quick evaluation should be performed # Decide if quick evaluation should be performed
...@@ -150,9 +150,11 @@ class Config_Postprocess(Config_runscript_base): ...@@ -150,9 +150,11 @@ class Config_Postprocess(Config_runscript_base):
:param silent: flag if print-statement are executed :param silent: flag if print-statement are executed
:return: status with True confirming success :return: status with True confirming success
""" """
status = False
if not os.path.isdir(dir_in): if not os.path.isdir(dir_in):
if not silent: print("{0} is not a directory".format(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: else:
status = True status = True
...@@ -184,7 +186,7 @@ class Config_Postprocess(Config_runscript_base): ...@@ -184,7 +186,7 @@ class Config_Postprocess(Config_runscript_base):
print("The base directory does not exist as well!") print("The base directory does not exist as well!")
return status 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)) _ = Config_Postprocess.get_subdir_list(os.path.dirname(model_path))
return status return status
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment