Skip to content

Commit

Permalink
Few fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
siebenkopf committed Feb 10, 2016
1 parent b2df561 commit fb9964b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 6 additions & 2 deletions bob/bio/base/script/grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def check_requirements(replacements):
for key in configuration.replace:
# check that the key is one of the known steps
if key not in steps:
raise ValueError("The step '%s' defined in the configuration file is unknown; choose one of %s" % (key, steps))
raise ValueError("The step '%s' defined in the configuration file '%s' is unknown; choose one of %s" % (key, args.configuration_file, steps))
values.update(extract_values(configuration.replace[key], replacements))
for requirement in configuration.requirements:
test = replace(requirement, values)
Expand Down Expand Up @@ -444,6 +444,10 @@ def main(command_line_parameters = None):
create_recursive(replace_dict, step_index = 0, directories = {}, dependency_level = 0)

# finally, write some information about the
logger.info("The number of executed tasks is: %d, which are split up into %d jobs that are executed in the grid" %(task_count, job_count))
if args.grid is not None:
logger.info("The number of executed tasks is: %d, which are split up into %d jobs that are executed in the grid" , task_count, job_count)

if args.parallel is not None:
logger.info("The total amount of finsihed tasks is: %d", task_count)

return score_directories
2 changes: 1 addition & 1 deletion bob/bio/base/tools/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def train_extractor(extractor, preprocessor, force = False):
if utils.check_file(fs.extractor_file, force, 1000):
logger.info("- Extraction: extractor '%s' already exists.", fs.extractor_file)
else:
bob.io.base.create_directories_safe(os.path.dirname(fs.extractor_file))
# read training files
train_files = fs.training_list('preprocessed', 'train_extractor', arrange_by_client = extractor.split_training_data_by_client)
train_data = read_preprocessed_data(train_files, preprocessor, extractor.split_training_data_by_client)
Expand All @@ -46,7 +47,6 @@ def train_extractor(extractor, preprocessor, force = False):
else:
logger.info("- Extraction: training extractor '%s' using %d training files:", fs.extractor_file, len(train_files))
# train model
bob.io.base.create_directories_safe(os.path.dirname(fs.extractor_file))
extractor.train(train_data, fs.extractor_file)


Expand Down
6 changes: 0 additions & 6 deletions bob/bio/base/tools/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ def submit(self, command, number_of_parallel_jobs = 1, dependencies=[], name = N
return self.fake_job_id


def grid_job_id(self):
id = os.getenv('JOB_ID')
if id is not None:
return int(id)
return id

def execute_local(self):
"""Starts the local deamon and waits until it has finished."""
logger.info("Starting jman deamon to run the jobs on the local machine.")
Expand Down
2 changes: 1 addition & 1 deletion bob/bio/base/utils/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def read_config_file(filename, keyword = None):
"""

if not os.path.exists(filename):
raise IOError("The given configuration file '%s' could not be found" % file)
raise IOError("The given configuration file '%s' could not be found" % filename)

import string
import random
Expand Down

0 comments on commit fb9964b

Please sign in to comment.