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

Correct path-construction to data split-templates.

parent c8588439
No related branches found
No related tags found
No related merge requests found
Pipeline #59786 passed
...@@ -104,11 +104,12 @@ class Config_Train(Config_runscript_base): ...@@ -104,11 +104,12 @@ class Config_Train(Config_runscript_base):
os.makedirs(self.destination_dir) os.makedirs(self.destination_dir)
# Create json-file for data splitting # Create json-file for data splitting
source_datasplit = os.path.join("..", "data_split", "datasplit_template.json") source_datasplit = os.path.join("..", "data_split", self.dataset, "datasplit_template.json")
dest_datasplit = os.path.join(self.destination_dir, "data_split.json") dest_datasplit = os.path.join(self.destination_dir, "data_split.json")
# sanity check (default data_split json-file exists) # sanity check (default data_split json-file exists)
if not os.path.isfile(source_datasplit): if not os.path.isfile(source_datasplit):
raise FileNotFoundError("%{0}: Could not find default data_split json-file '{1}'".format(method_name, source_datasplit)) raise FileNotFoundError("%{0}: Could not find default data_split json-file '{1}'".format(method_name,
source_datasplit))
# ...copy over json-file for data splitting... # ...copy over json-file for data splitting...
os.system("cp "+source_datasplit+" "+dest_datasplit) os.system("cp "+source_datasplit+" "+dest_datasplit)
# ...and open vim after some delay # ...and open vim after some delay
...@@ -119,16 +120,18 @@ class Config_Train(Config_runscript_base): ...@@ -119,16 +120,18 @@ class Config_Train(Config_runscript_base):
sp.call("sed -i '/^#/d' {0}".format(dest_datasplit), shell=True) sp.call("sed -i '/^#/d' {0}".format(dest_datasplit), shell=True)
# Create json-file for hyperparameters # Create json-file for hyperparameters
source_hparams = os.path.join("..","hparams", self.dataset, self.model, "model_hparams.json") source_hparams = os.path.join("..","hparams", self.dataset, self.model, "model_hparams_template.json")
dest_hparams = os.path.join(self.destination_dir, "model_hparams.json")
# sanity check (default hyperparameter json-file exists) # sanity check (default hyperparameter json-file exists)
if not os.path.isfile(source_hparams): if not os.path.isfile(source_hparams):
raise FileNotFoundError("%{0}: Could not find default hyperparameter json-file '%{1}'".format(method_name, source_hparams)) raise FileNotFoundError("%{0}: Could not find default hyperparameter json-file '%{1}'".format(method_name,
source_hparams))
# ...copy over json-file for hyperparamters... # ...copy over json-file for hyperparamters...
os.system("cp "+source_hparams+" "+self.destination_dir) os.system("cp "+source_hparams+" "+dest_hparams)
# ...and open vim after some delay # ...and open vim after some delay
print("*** Please configure the model hyperparameters:") print("*** Please configure the model hyperparameters:")
time.sleep(3) time.sleep(3)
cmd_vim = os.environ.get('EDITOR', 'vi') + ' ' + os.path.join(self.destination_dir, "model_hparams.json") cmd_vim = os.environ.get('EDITOR', 'vi') + ' ' + dest_hparams
sp.call(cmd_vim, shell=True) sp.call(cmd_vim, shell=True)
# #
# ----------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment