-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (23 loc) · 702 Bytes
/
main.py
File metadata and controls
30 lines (23 loc) · 702 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
import argparse
import os
import tensorflow as tf
from model import Model
from configure import conf
"""This script defines hyperparameters.
"""
def main(_):
parser = argparse.ArgumentParser()
parser.add_argument('--option', dest='option', type=str, default='train',
help='actions: train or predict')
args = parser.parse_args()
if args.option not in ['train', 'predict']:
print('invalid option: ', args.option)
print("Please input a option: train or predict")
else:
model = Model(conf)
getattr(model, args.option)()
if __name__ == '__main__':
# Choose which gpu or cpu to use
os.environ['CUDA_VISIBLE_DEVICES'] = '5'
tf.logging.set_verbosity(tf.logging.INFO)
tf.app.run()