-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtune_one.py
26 lines (18 loc) · 819 Bytes
/
tune_one.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
from experiment.hyperparametertuning import HyperparameterTuning
from experiment.distracteddrivingexperiment import DistractedDrivingExperimentNFold
from utils.loggerwrapper import GLOBAL_LOGGER
from utils.utils import set_available_gpus
def get_dataset(name):
if name.startswith("distracteddriving_fold_"):
return DistractedDrivingExperimentNFold(GLOBAL_LOGGER, int(name[-5:-3]), int(name[-2:]))
raise Exception(f"No such dataset/experiment as {name}")
if __name__ == '__main__':
try:
_, gpu_id, dataset_name, clas, max_eval = sys.argv
set_available_gpus(gpu_id)
dataset = get_dataset(dataset_name)
HyperparameterTuning(dataset, [gpu_id]).tune_one(clas, int(max_eval))
except Exception as e:
GLOBAL_LOGGER.exception(e)
raise e