forked from tensorflow/models
-
Notifications
You must be signed in to change notification settings - Fork 2
/
valohai.yaml
209 lines (207 loc) · 6.75 KB
/
valohai.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
---
- step:
name: Convert Mask to GrayScale
description: Converts Mask Images to Grayscale
image: tensorflow/tensorflow:1.15.4-gpu-py3
command:
- apt-get update
- apt-get install ffmpeg libsm6 libxext6 -y
- pip install opencv-python
- mkdir /valohai/outputs/
- python research/deeplab/mask_to_grayscale.py
inputs:
- name: RGB-Masks-folder
default: azure://sampledatavalohai/sampledata/Mask Image/*
keep-directories: suffix
- name: class-index-file
default: azure://sampledatavalohai/sampledata/class_list.txt
- name: metadata-filepath
default: azure://sampledatavalohai/sampledata/metadata.json
- step:
name: Load data and convert
description: Converts data to TFRecord file format with Example protos
image: tensorflow/tensorflow:1.15.4-gpu-py3
command:
- python research/deeplab/datasets/build_voc2012_data.py
inputs:
- name: Label-Folder
keep-directories: suffix
- name: Image-Folder
default: azure://sampledatavalohai/sampledata/Raw_Image/*
keep-directories: suffix
- name: Split-Folder
default: azure://sampledatavalohai/sampledata/SplitFolder/*
keep-directories: suffix
- step:
name: Batch inference
image: tensorflow/tensorflow:1.15.4-gpu-py3
command:
- apt-get update
- apt-get install ffmpeg libsm6 libxext6 -y
- pip install -r requirements.txt
- mkdir /valohai/outputs/results
- python research/deeplab/batch_inference.py
inputs:
- name: model
default: datum://0177d826-de0c-f542-57b1-883f9c9ad5ba
- name: test-images
default: azure://sampledatavalohai/sampledata/data/01EY5/01EY5YHQYRT70D8Q390Q4A0K2B/upload/6_gtFine_labelIds.png
- step:
name: Train DeepLab model
image: tensorflow/tensorflow:1.15.4-gpu-py3
command:
- export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/research/slim:`pwd`/research
- pip install -r requirements.txt
- unzip /valohai/inputs/tfrecords/tfrecords.zip -d /valohai/inputs/tfrecords
- python research/deeplab/train.py --atrous_rates=6 --atrous_rates=12 --atrous_rates=18 {parameters}
inputs:
- name: tfrecords
default: azure://sampledatavalohai/sampledata/data/01EY5/01EY5YHQYRT70D8Q390Q4A0K2B/output-29/tfrecords.zip
parameters:
- name: logtostderr
type: flag
default: True
pass-as: --logtostderr={v}
- name: training_number_of_steps
type: integer
default: 150000
description: "The number of steps used for training"
- name: train_split
type: string
default: "train"
description: "Which split of the dataset to be used for training"
- name: model_variant
type: string
default: "xception_65"
- name: output_stride
type: integer
default: 16
- name: decoder_output_stride
type: integer
default: 4
- name: train_crop_size
type: string
default: "513,513"
description: "Image crop size [height, width] during training."
- name: train_batch_size
type: integer
default: 4
description: "The number of images in each batch during training."
- name: min_resize_value
type: integer
default: 513
- name: max_resize_value
type: integer
default: 513
- name: resize_factor
type: integer
default: 16
- name: dataset
type: string
default: "pascal_voc_seg"
description: "Name of the segmentation dataset."
- name: train_logdir
type: string
default: "/valohai/repository/trainlog/"
- step:
name: Save Frozen Graph
description: Converts model checkpoints to frozen graph
image: tensorflow/tensorflow:1.15.4-gpu-py3
command:
- export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/research/slim:`pwd`/research
- pip install -r requirements.txt
- mkdir /valohai/outputs/Logs
- mkdir trainlog
- tar -xvzf /valohai/inputs/checkpoint-path/checkpoints.tar.gz -C /valohai/repository/trainlog/
- python research/deeplab/export_model.py {parameters}
inputs:
- name: checkpoint-path
default: datum://0177d3ab-28eb-093e-3d22-67ab3616374a
parameters:
- name: checkpoint_path
type: string
default: "/valohai/repository/trainlog/"
- name: logtostderr
type: flag
default: True
pass-as: --logtostderr={v}
- name: model_variant
type: string
default: "xception_65"
- name: output_stride
type: integer
default: 16
- name: decoder_output_stride
type: integer
default: 4
- name: num_classes
type: integer
default: 3
- name: export_path
type: string
default: /valohai/outputs/frozen_inference_graph.pb
- endpoint:
name: predict-deeplab
description: returns image
image: drazend/car-deployment:latest
server-command: python research/deeplab/predict.py
files:
- name: model
path: frozen_inference_graph_1000.pb
port: 8000
- pipeline:
name: TCSSample
nodes:
- name: convert-node
type: execution
step: Convert Mask to GrayScale
- name: load-node
type: execution
step: Load data and convert
- name: train-node
type: execution
step: Train DeepLab model
override:
inputs:
- name: tfrecords
- name: save-node
type: execution
step: Save Frozen Graph
override:
inputs:
- name: checkpoint-path
edges:
- [convert-node.output.*, load-node.input.Label-Folder]
- [load-node.output.tfrecords.zip, train-node.input.tfrecords]
- [train-node.output.*, save-node.input.checkpoint-path]
- pipeline:
name: TCSSample with deployment
nodes:
- name: convert-node
type: execution
step: Convert Mask to GrayScale
- name: load-node
type: execution
step: Load data and convert
- name: train-node
type: execution
step: Train DeepLab model
override:
inputs:
- name: tfrecords
- name: save-node
type: execution
step: Save Frozen Graph
override:
inputs:
- name: checkpoint-path
- name: deploy-node
type: deployment
deployment: test
endpoints:
- predict-deeplab
edges:
- [convert-node.output.*, load-node.input.Label-Folder]
- [load-node.output.tfrecords.zip, train-node.input.tfrecords]
- [train-node.output.*, save-node.input.checkpoint-path]
- [save-node.output.*.pb, deploy-node.file.predict-deeplab.model]