-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (31 loc) · 1.08 KB
/
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
31
32
33
import configparser
from trainer import train
from utils import getConfig
import os
import sys
if __name__ == '__main__':
os.chdir(sys.path[0])
configName = getConfig()
config = configparser.ConfigParser()
config.read('./config/'+configName, encoding='utf-8')
model_parameters = config['model_parameters']
others = config['others']
train(
configName=configName,
model_parameters=model_parameters,
modelType=model_parameters['modelType'],
rateSize=int(others['rateSize']),
optim=others['optim'],
lr=float(others['lr']),
momentum=float(others['momentum']),
n_class=int(model_parameters['n_class']),
epochSize=int(others['epochSize']),
n_train_sample=int(others['n_train_sample']),
n_test_sample=int(others['n_test_sample']),
device=str(others['device']),
Rdevice=int(others['Rdevice']),
dataset=others['dataset'],
dataPATH=others['dataPATH'],
logPATH=others['logPATH'],
top_n_acc=int(others['top_n_acc']),
)