-
Notifications
You must be signed in to change notification settings - Fork 0
/
executer.py
49 lines (37 loc) · 1.42 KB
/
executer.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
import pandas as pd
from datetime import datetime as dt
from hcml.model.train import run
import tensorflow as tf
# Set python level verbosity
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.DEBUG)
# Set C++ Graph Execution level verbosity
os.environ['TF_CPP_MIN_LOG_LEVEL'] = str(tf.compat.v1.logging.DEBUG)
base_path = "/mnt/disks/data/fma/trains"
id = "hierarchical_all"
train_path = os.path.join(base_path,id)
tfrecords_path =os.path.join(train_path,'tfrecords')
metadata_path = os.path.join(train_path,"metadata.json")
labels_path = os.path.join(train_path,"labels.json")
args = pd.Series({
"batch_size":32,
"epochs":10,
"dropout":0.1,
'patience':1,
'max_queue_size':64,
"labels_path": labels_path,
"metadata_path": metadata_path,
"trainset_pattern": os.path.join(tfrecords_path,'train'),
"testset_pattern": os.path.join(tfrecords_path,'test'),
"valset_pattern": os.path.join(tfrecords_path,'val')
})
if __name__ == '__main__':
time_start = dt.utcnow()
print("[{}] Experiment started at {}".format(id, time_start.strftime("%H:%M:%S")))
print(".......................................")
print(args)
run(args)
time_end = dt.utcnow()
time_elapsed = time_end - time_start
print(".......................................")
print("[{}] Experiment finished at {} / elapsed time {}s".format(id, time_end.strftime("%H:%M:%S"), time_elapsed.total_seconds()))