forked from orobix/retina-unet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_testing.py
31 lines (27 loc) · 1.03 KB
/
run_testing.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
###################################################
#
# Script to execute the prediction
#
##################################################
import os
import ConfigParser
#config file to read from
config = ConfigParser.RawConfigParser()
config.readfp(open(r'./configuration.txt'))
#===========================================
#name of the experiment!!
name_experiment = config.get('experiment name', 'name')
nohup = config.getboolean('testing settings', 'nohup') #std output on log file?
#create a folder for the results if not existing already
result_dir = name_experiment
print "\n1. Create directory for the results (if not already existing)"
if not os.path.exists(result_dir):
os.system('mkdir -p ' + result_dir)
# finally run the prediction
if nohup:
print "\n2. Run the prediction on GPU with nohup"
os.system('nohup python -u ./src/predict.py > ./{}/{}_prediction.nohup'.
format(name_experiment, name_experiment))
else:
print "\n2. Run the prediction on GPU (no nohup)"
os.system('python ./src/predict.py')