Jeong Geol Kim пре 5 година
родитељ
комит
669e43da83

+ 3
- 0
.vscode/settings.json Прегледај датотеку

@@ -0,0 +1,3 @@
1
+{
2
+    "python.pythonPath": "C:\\Users\\atari\\Miniconda3\\envs\\chouse\\python.exe"
3
+}

+ 0
- 0
acc_save/sample_shape_mobilenetv2_201118.txt Прегледај датотеку


+ 2
- 0
learning_cofigurations/sample_shape_mobilenetv2_201118.lcfg Прегледај датотеку

@@ -0,0 +1,2 @@
1
+{ModelName} {Epoch} {batch_size} {Optmizer} {Loss_rate} {} {} {save_period}
2
+MobileNetV2 5000 100 

+ 5
- 0
recorder.py Прегледај датотеку

@@ -0,0 +1,5 @@
1
+import os
2
+import sys
3
+import pandas
4
+import torch
5
+import torchvision

+ 91
- 0
train_model_1.0.py Прегледај датотеку

@@ -0,0 +1,91 @@
1
+import argparse
2
+import torch
3
+import torchvision.models
4
+import sys
5
+import pandas
6
+
7
+
8
+
9
+'''
10
+filename:train_model_1.0.py
11
+create date: 11/17/2020 Tue
12
+Author: Jeong Geol Kim
13
+Contact: atarib4816@gmail.com
14
+Description: This .py file will train, save weight and save Results with parameters. parameters will input by .txt file.
15
+eg) train_model_1.0.py -r train_parameter.lcfg
16
+guidelines for train_parameter.txt
17
+filename format: partofarchitecture_backbone_yymmdd.lcfg
18
+eg) shapesort_mobilenetv2_201118.txt
19
+'''
20
+
21
+
22
+def Params_Set():
23
+    '''
24
+    Description: read options from .lcfg and initialize learning options.
25
+    You should write 
26
+    '''
27
+    HELP_TEXT = "how to use .py" #TODO: write description more precisely
28
+    N_OF_PARAMS = 3 #from now on, .txt file has 3 pramas(backbone Name, iterations, save period)
29
+
30
+    parser = argparse.ArgumentParser(description = HELP_TEXT)
31
+    parser.add_argument("-r", required = True, help = '.lcfg file contains with learning configures')
32
+    args = parser.parse_args()
33
+
34
+    f = open(args.r, 'r')    
35
+    p_string = f.readline()
36
+    f.close()
37
+    params = p_string.split()
38
+
39
+    if str(args.r[-4:]) != 'lcfg':
40
+        print ("Error: {} is wrong filename extension. Learning configures must written in .lcfg file")
41
+        return 
42
+    elif len(params) != N_OF_PARAMS: 
43
+        print("Error: {} is broken. please check learning configures.".format(args.r))
44
+        return
45
+    else:
46
+        print("---Learning Options---")
47
+        print("Backbone Name: {}".format(params[0]))
48
+        print("Number of iterations: {}".format(params[1]))
49
+        print("Period of saving weight: {}".format(params[2]))
50
+        return params, args.r
51
+
52
+
53
+def Preprocess():
54
+    pass
55
+
56
+
57
+
58
+def Model_Construct():
59
+    pass
60
+
61
+def Train():
62
+    pass
63
+
64
+def Save_Weight():
65
+    pass
66
+
67
+
68
+def Result():
69
+    pass
70
+
71
+
72
+
73
+
74
+if __name__ == "__main__":
75
+    #get all params from option files
76
+    params, name_of_lcfg = Params_Set()
77
+
78
+    Preprocess()
79
+
80
+    Model_Construct()
81
+
82
+    Train()   
83
+
84
+    Save_Weight()
85
+
86
+    Result()
87
+
88
+
89
+
90
+
91
+

+ 1
- 0
weights_backup/sample_shape_mobilenetv2_201118/100_sample_shape_mobilenetv2_201118.rtf Прегледај датотеку

@@ -0,0 +1 @@
1
+{\rtf1}

+ 1
- 0
weights_backup/sample_shape_mobilenetv2_201118/200_sample_shape_mobilenetv2_201118 - Copy.rtf Прегледај датотеку

@@ -0,0 +1 @@
1
+{\rtf1}

Loading…
Откажи
Сачувај