forked from gcrois/transcript-ml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingleexec.py
More file actions
32 lines (25 loc) · 835 Bytes
/
singleexec.py
File metadata and controls
32 lines (25 loc) · 835 Bytes
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
import sys
import resnet
import pandas as pd
import tensorflow as tf
import pickle
job_n = sys.argv[1]
gpu_n = sys.argv[2]
jobs = pickle.load( open( f"data/j{job_n}.pickle", "rb" ) )[163:]
data = pd.DataFrame(
columns=["HiddenLayers", "LearningRate", "Optimizer",
"NumFilters", "Activation", "KernelSize",
"Momentum", "Epochs", "Loss",
"Acc", "Val_Loss", "Val_Acc",]
)
filename = f"data/{job_n}_results.csv"
#data.to_csv(filename, header=True)
print(f"Starting job #{job_n} on gpu #{gpu_n}")
try:
for j in range(len(jobs)):
print(f"Starting job #{j} of {len(jobs) - 1}\n")
resnet.ResNet(**jobs[j]).to_csv(filename, mode='a', header=False)
print(f"Done with job # {j} or {len(jobs) - 1}\n")
except:
print("interrupted! trying to save data")
sys.exit(0)