Skip to content

Commit 83c2b3f

Browse files
judgeeeeeejudgeeeeee
andauthored
feat(*): update ormbfile struct (#150)
* feat(*): update ormbfile struct * feat(*):update model struct * doc(*): update docs * feat(*): update MXNETParams -> MXNetParams * feat(example):update MXNet model name * feat(example):update dType examples and docs Co-authored-by: judgeeeeee <[email protected]>
1 parent e4867e6 commit 83c2b3f

File tree

12 files changed

+42
-52
lines changed

12 files changed

+42
-52
lines changed

docs/docs_zh/introduction.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ spec:
283283
"value": "0.928"
284284
}
285285
],
286-
"hyperparameters": [
286+
"hyperParameters": [
287287
{
288288
"name": "batch_size",
289289
"value": "32"
@@ -298,7 +298,7 @@ spec:
298298
224,
299299
3
300300
],
301-
"dtype": "float64",
301+
"dType": "float64",
302302
}
303303
],
304304
"outputs": [
@@ -308,14 +308,12 @@ spec:
308308
1,
309309
1001
310310
],
311-
"dtype": "float64",
311+
"dType": "float64",
312312
}
313313
],
314-
"layers": [
315-
{
316-
"name": "conv"
317-
}
318-
]
314+
"layers": {
315+
"conv": 1
316+
}
319317
},
320318
"training": {
321319
"git": {

docs/introduction.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ When it comes to the specific supporting for model, we define our own [config](h
289289
"value": "0.928"
290290
}
291291
],
292-
"hyperparameters": [
292+
"hyperParameters": [
293293
{
294294
"name": "batch_size",
295295
"value": "32"
@@ -304,7 +304,7 @@ When it comes to the specific supporting for model, we define our own [config](h
304304
224,
305305
3
306306
],
307-
"dtype": "float64",
307+
"dType": "float64",
308308
}
309309
],
310310
"outputs": [
@@ -314,14 +314,12 @@ When it comes to the specific supporting for model, we define our own [config](h
314314
1,
315315
1001
316316
],
317-
"dtype": "float64",
317+
"dType": "float64",
318318
}
319319
],
320-
"layers": [
321-
{
322-
"name": "conv"
323-
}
324-
]
320+
"layers": {
321+
"conv": 1
322+
}
325323
},
326324
"training": {
327325
"git": {

docs/spec-v1alpha1.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ Tensors are multi-dimensional arrays with a uniform type.
3333

3434
Description of the tensor.
3535

36-
- **dtype** string, OPTIONAL
36+
- **dType** string, OPTIONAL
3737

3838
DType of the tensor.
3939

4040
- **size** object, OPTIONAL
4141

4242
Size of the tensor.
4343

44-
- **optype** string, OPTIONAL
44+
- **opType** string, OPTIONAL
4545

4646
OpType of the tensor, It is only used for PMML.
4747

@@ -113,9 +113,9 @@ Note: Any OPTIONAL field MAY also be set to null, which is equivalent to being a
113113

114114
Value of the metric
115115

116-
- **hyperparameters** object, OPTIONAL
116+
- **hyperParameters** object, OPTIONAL
117117

118-
Hyperparameters of the model
118+
HyperParameters of the model
119119

120120
- **name** string, REQUIRED
121121

@@ -179,7 +179,7 @@ Here is an example model configuration JSON document:
179179
"value": "0.9"
180180
}
181181
],
182-
"hyperparameters": [
182+
"hyperParameters": [
183183
{
184184
"name": "batch_size",
185185
"value": "32"
@@ -194,7 +194,7 @@ Here is an example model configuration JSON document:
194194
224,
195195
3
196196
],
197-
"dtype": "float64",
197+
"dType": "float64",
198198
}
199199
],
200200
"outputs": [
@@ -204,14 +204,12 @@ Here is an example model configuration JSON document:
204204
1,
205205
1000
206206
],
207-
"dtype": "float64",
207+
"dType": "float64",
208208
}
209209
],
210-
"layers": [
211-
{
212-
"name": "conv"
213-
}
214-
]
210+
"layers": {
211+
"conv" : 1
212+
}
215213
},
216214
"training": {
217215
"git": {

examples/Caffe2-model/ormbfile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ signature:
88
- 3
99
- 224
1010
- 224
11-
dtype: float32
11+
dType: float32
1212
outputs:
1313
- name: softmax
1414
size:
1515
- 1
1616
- 1000
17-
dtype: float32
17+
dType: float32

examples/GraphDef-model/ormbfile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ framework: TensorFlow
44
signature:
55
inputs:
66
- name: input_1
7-
dtype: float32
7+
dType: float32
88
size:
99
- -1
1010
- 224
1111
- 224
1212
- 3
1313
outputs:
1414
- name: Logits/Softmax
15-
dtype: float32
15+
dType: float32
1616
size:
1717
- -1
1818
- 1000

examples/MXNETParams-model/model/mobilenet_v2-0000.params renamed to examples/MXNetParams-model/model/mobilenet_v2-0000.params

File renamed without changes.

examples/MXNETParams-model/model/mobilenet_v2-symbol.json renamed to examples/MXNetParams-model/model/mobilenet_v2-symbol.json

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
author: "chenjun <[email protected]>"
2-
format: MXNETParams
2+
format: MXNetParams
33
signature:
44
inputs:
55
- name: data
@@ -8,5 +8,5 @@ signature:
88
- 3
99
- 224
1010
- 224
11-
dtype: float32
11+
dType: float32
1212

examples/TorchScript-model/ormbfile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ signature:
88
- 3
99
- 224
1010
- 224
11-
dtype: float32
11+
dType: float32
1212
outputs:
1313
- name: input__9
1414
size:
1515
- 1
1616
- 1000
17-
dtype: float32
17+
dType: float32

pkg/model/format.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
FormatPMML Format = "PMML"
2020
FormatCaffeModel Format = "CaffeModel"
2121
FormatNetDef Format = "NetDef"
22-
FormatMXNETParams Format = "MXNETParams"
22+
FormatMXNetParams Format = "MXNetParams"
2323
FormatTorchScript Format = "TorchScript"
2424
FormatGraphDef Format = "GraphDef"
2525
FormatTensorRT Format = "TensorRT"
@@ -53,8 +53,8 @@ func (f Format) ValidateDirectory(rootPath string) error {
5353
err = f.validateForCaffeModel(modelFilePath, fileList)
5454
case FormatNetDef:
5555
err = f.validateForNetDef(modelFilePath, fileList)
56-
case FormatMXNETParams:
57-
err = f.validateForMXNETParams(modelFilePath, fileList)
56+
case FormatMXNetParams:
57+
err = f.validateForMXNetParams(modelFilePath, fileList)
5858
case FormatTorchScript:
5959
err = f.validateForTorchScript(modelFilePath, fileList)
6060
case FormatGraphDef:
@@ -182,7 +182,7 @@ func (f Format) validateForNetDef(modelPath string, files []os.FileInfo) error {
182182
return nil
183183
}
184184

185-
func (f Format) validateForMXNETParams(modelPath string, files []os.FileInfo) error {
185+
func (f Format) validateForMXNetParams(modelPath string, files []os.FileInfo) error {
186186
var jsonFileNum int32
187187
var paramsFileNum int32
188188
for _, file := range files {

0 commit comments

Comments
 (0)