-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharguments.py
executable file
·83 lines (67 loc) · 3.65 KB
/
arguments.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"""
@author: ShaktiWadekar
"""
import argparse
def parse_args():
parser = argparse.ArgumentParser(description='process file paths')
# collect the paths first
parser.add_argument('--dataset_csv_path', default='driving_log.csv',
type=str,
help='csv file contains path to all images, \
steering and throttle data for training and \
testing. Default: driving_log.csv in current \
directory')
parser.add_argument('--model_save_path', default='trained_models', type=str,
help='path to save model. Default: current directory')
parser.add_argument('--model_load_path', default='', type=str,
help='path to load model. Default: current directory')
# input image arguments
parser.add_argument('--IMAGE_HEIGHT', default=80, type=int,
help='input image resized to this height. Default 80')
parser.add_argument('--IMAGE_WIDTH', default=160, type=int,
help='input image resized to this width. Default 160')
# training arguments
parser.add_argument('--batch_size', default=128, type=int,\
help='')
parser.add_argument('--train_epochs', default=500, type=int,\
help='')
parser.add_argument('--optimizer', default='adam',\
help='')
parser.add_argument('--save_rate', default=50, type=int,\
help='save model every save_rate epoch. Default: every 200th epoch')
# Used BOTH in throttle training and drive
parser.add_argument('--steering_model_epoch', default=400, type=int, \
help='Used for loading specific steering model \
during throttle training and drive')
parser.add_argument('--throttle_model_epoch', default=400, type=int, \
help='Used for loading specific throttle model \
during only drive')
# testing arguments
parser.add_argument('--test_epochs', default=1, type=int,\
help='')
parser.add_argument('--test_rate', default=10, type=int,\
help='test model every test_rate epoch. Default: every 10th epoch')
# important
parser.add_argument('--cuda', default='True', type=bool,\
help='Important *******Should be True when training on GPU. \
Should be False when driving on track *********')
# general
parser.add_argument('--log_dir', default='', type=str,\
help='')
parser.add_argument('--log_file', default='log.json', type=str,\
help='')
parser.add_argument('--plot_file', default='plot.png', type=str,\
help='')
parser.add_argument('--auto_plot', default='True', type=bool,\
help='')
parser.add_argument('--clean_start', default='False', type=bool,\
help='')
# drive
parser.add_argument('--fullpath_DriveNet', default='model_DriveNet.pth', type=str,\
help='DriveNet file path directory+file. \
Default current: Currentdirectory+model_DriveNet.pth')
parser.add_argument('--look_for_lower', default=False, type=bool,\
help='Set it True if you want to automatically check and load \
lower steering_epoch throttle model')
args = parser.parse_args()
return args