Skip to content
Snippets Groups Projects
Commit 69f7a3b5 authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

fix

parent 5f2affa8
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ def add_worker_pool_args(parser):
type=int,
metavar="N",
help="Number of processes to parallelize training over. Experimental. "
"Set to 1 for serial run. Set to 0 to use number of cores. Default: %(default)s.")
"Set to 0 for serial run. Default: %(default)s.")
group.add_argument(
"--backend",
choices=("tensorflow-gpu", "tensorflow-cpu", "tensorflow-default"),
......@@ -67,7 +67,7 @@ def worker_pool_with_gpu_assignments(
num_workers = num_jobs if num_jobs else cpu_count()
if num_workers == 1:
if num_workers == 0:
if backend:
set_keras_backend(backend)
return None
......
......@@ -146,11 +146,12 @@ def run_and_check(n_jobs=0):
if os.environ.get("KERAS_BACKEND") != "theano":
def test_run_parallel():
run_and_check(n_jobs=1)
run_and_check(n_jobs=2)
def test_run_serial():
run_and_check(n_jobs=1)
run_and_check(n_jobs=0)
if __name__ == "__main__":
test_run_serial()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment