-
Notifications
You must be signed in to change notification settings - Fork 99
/
main_cnn.py
61 lines (42 loc) · 1.39 KB
/
main_cnn.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# main.py ---
#
# Filename: config.py
# Description: Main file of the 3DSmoothNet feature descriptor. Parameters can be seen in the core/config.py file.
#
# Author: Gojcic Zan, Zhou Caifa
# Project: 3DSmoothNet https://github.com/zgojcic/3DSmoothNet
# Paper: https://arxiv.org/abs/1811.06879
# Created: 03.04.2019
# Version: 1.0
# Copyright (C)
# IGP @ ETHZ
# Code:
# Import python dependencies
import tensorflow as tf
# Import custom functions
from core import config
from core import network
print('The version of TF is {}'.format(tf.__version__))
config_arguments, unparsed_arguments = config.get_config()
def main(config_arguments):
# Build the model and optimizer
smooth_net = network.NetworkBuilder(config_arguments)
print('Run mode "{}" selected.'.format(config_arguments.run_mode))
# Select the run mode
if config_arguments.run_mode == "train":
smooth_net.train()
elif config_arguments.run_mode == "test":
# Evaluate the network
smooth_net.test()
else:
raise ValueError('%s is not a valid run mode.'.format(config_arguments.run_mode))
if __name__ == "__main__":
# Parse configuration
config_arguments, unparsed_arguments = config.get_config()
# If we have unparsed arguments, print usage and exit
if len(unparsed_arguments) > 0:
config.print_usage()
exit(1)
main(config_arguments)
#
# main.py ends here