-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.py
30 lines (25 loc) · 795 Bytes
/
main.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
# coding='utf-8'
'''
author: Youzhao Yang
date: 05/08/2018
github: https://github.com/nnuyi
'''
import tensorflow as tf
from config import Config
from PeleeNet import PeleeNet
def main():
config = Config()
config.check_dir()
config.print_config()
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5)
gpu_options.allow_growth = True
sess_config = tf.ConfigProto(gpu_options=gpu_options, allow_soft_placement=True)
with tf.Session(config=sess_config) as sess:
peleenet = PeleeNet(config=config.config, sess=sess)
peleenet.build_model()
if config.config.is_training:
peleenet.train_model()
if config.config.is_testing:
peleenet.test_model()
if __name__=='__main__':
main()