summaryrefslogtreecommitdiff
path: root/src/training/prepare_experiments.py
diff options
context:
space:
mode:
authoraktersnurra <gustaf.rydholm@gmail.com>2020-08-03 23:33:34 +0200
committeraktersnurra <gustaf.rydholm@gmail.com>2020-08-03 23:33:34 +0200
commit07dd14116fe1d8148fb614b160245287533620fc (patch)
tree63395d88b17a14ad453c52889fcf541e6cbbdd3e /src/training/prepare_experiments.py
parent704451318eb6b0b600ab314cb5aabfac82416bda (diff)
Working Emnist lines dataset.
Diffstat (limited to 'src/training/prepare_experiments.py')
-rw-r--r--src/training/prepare_experiments.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/training/prepare_experiments.py b/src/training/prepare_experiments.py
index eb872d7..5a665b3 100644
--- a/src/training/prepare_experiments.py
+++ b/src/training/prepare_experiments.py
@@ -1,12 +1,13 @@
"""Run a experiment from a config file."""
import json
-from subprocess import check_call
+from subprocess import run
import click
from loguru import logger
import yaml
+# flake8: noqa: S404,S607,S603
def run_experiments(experiments_filename: str) -> None:
"""Run experiment from file."""
with open(experiments_filename) as f:
@@ -15,10 +16,19 @@ def run_experiments(experiments_filename: str) -> None:
for index in range(num_experiments):
experiment_config = experiments_config["experiments"][index]
experiment_config["experiment_group"] = experiments_config["experiment_group"]
- # cmd = f"python training/run_experiment.py --gpu=-1 '{json.dumps(experiment_config)}'"
- cmd = f"poetry run run-experiment --gpu=-1 --save --experiment_config '{json.dumps(experiment_config)}'"
+ cmd = f"poetry run run-experiment --gpu=-1 --save --experiment_config={json.dumps(experiment_config)}"
print(cmd)
- check_call(cmd, shell=True)
+ run(
+ [
+ "poetry",
+ "run",
+ "run-experiment",
+ "--gpu=-1",
+ "--save",
+ f"--experiment_config={json.dumps(experiment_config)}",
+ ],
+ check=True,
+ )
@click.command()