-
Notifications
You must be signed in to change notification settings - Fork 17
/
eval.py
35 lines (26 loc) · 835 Bytes
/
eval.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
import tensorflow as tf
from google.protobuf import text_format
from proto.eval_config_pb2 import EvalConfig
from core import evaluator_interactive as evaluator
import os
tf.logging.set_verbosity(tf.logging.INFO)
flags = tf.app.flags
flags.DEFINE_string('config_file', './model/eval.config',
'Path of config file')
flags.DEFINE_integer('id', 0,
'Path of config file')
FLAGS = flags.FLAGS
id = FLAGS.id
os.environ["CUDA_VISIBLE_DEVICES"] = '%d'%(id%4)
def get_configs():
eval_config = EvalConfig()
with open(FLAGS.config_file, 'r') as f:
text_format.Merge(f.read(), eval_config)
tf.logging.info(eval_config)
return eval_config
def main():
eval_config = get_configs()
evaluator.evaluate(eval_config)
if __name__ == '__main__':
#tf.app.run()
main()