Fix: When total epochs is less than cpu cores

This commit is contained in:
Fredrik81 2020-02-29 23:41:59 +01:00
parent ac7fa8252b
commit 7a4edb1cd8

View File

@ -557,6 +557,8 @@ class Hyperopt:
cpus = cpu_count()
logger.info(f"Found {cpus} CPU cores. Let's make them scream!")
config_jobs = self.config.get('hyperopt_jobs', -1)
if self.total_epochs < cpus:
config_jobs = self.total_epochs
logger.info(f'Number of parallel jobs set as: {config_jobs}')
self.dimensions: List[Dimension] = self.hyperopt_space()