You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: c_cxx/accuracy_tool/README.md
+55-24Lines changed: 55 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,8 +112,7 @@ models/
112
112
|
113
113
+--> resnet/
114
114
| |
115
-
| +--> model.onnx
116
-
| +--> model.qdq.onnx (quantized model only required for certains EPs like QNN)
115
+
| +--> model.onnx (see options --ground_truth_model_name and --ep_model_name)
117
116
| |
118
117
| +--> test_data_set_0/
119
118
| | |
@@ -127,17 +126,16 @@ models/
127
126
|
128
127
+--> mobilenet/
129
128
|
130
-
+--> model.onnx
131
-
+--> model.qdq.onnx
129
+
+--> model.onnx (Note: same model name)
132
130
|
133
131
+--> test_data_set_0/
134
132
+--> test_data_set_1/
135
133
```
136
134
137
-
- All ONNX models must be named either `model.onnx` or `model.qdq.onnx`.
138
-
- The `model.qdq.onnx` file is only necessary for execution providers that run quantized models (e.g., QNN).
135
+
- By default, tool expects all ONNX models to be named `model.onnx`.
136
+
- Use the option `--ground_truth_model_name` to set the name of the model used to get the expected (ground-truth) output with CPU EP. Defaults to `model.onnx`.
137
+
- Use the option `--ep_model_name` to set the name of the model loaded by the EP under test. Defaults to `model.onnx`.
139
138
- If the expected output files are not provided, the expected outputs will be obtained by running `model.onnx` on the CPU execution provider.
140
-
- Both `model.qdq.onnx` and `model.onnx` must have the same input and output signature (i.e., same names, shapes, types, and ordering).
141
139
- The dataset directories must be named `test_data_set_<index>/`, where `<index>` ranges from 0 to the number of dataset directories.
142
140
- The raw input files must be named `input_<index>.raw`, where `<index>` corresponds to the input's index in the ONNX model.
143
141
- The raw output files are not required if `model.onnx` is provided.
Use the `-o` command-line option to write the accuracy results to file.
205
215
```shell
206
-
$ .\accuracy_test -o results.csv -e cpu models
216
+
$ .\accuracy_test -o results.csv -e cpu --ep_model_name model.qdq.onnx models
207
217
208
218
[INFO]: Saved accuracy results to results.csv
209
219
```
210
220
211
221
### Dump (and load) the expected outputs to disk
212
222
Use the `-s` command-line option to dump the expected outputs to disk (e.g., output_0.raw). The expected outputs are obtained by running `model.onnx` on the CPU EP regardless of the EP passed to the `-e` command-line option.
213
223
```shell
214
-
$ .\accuracy_test -s -e cpu models
224
+
$ .\accuracy_test -s -e cpu --ep_model_name model.qdq.onnx models
Use the `-a` command-line option to compare subsequent runs with previous accuracy results (e.g., results_0.csv). This can help detect accuracy regressions.
250
262
251
263
```shell
252
-
.\accuracy_test -a results_o.csv -e qnn "backend_path|QnnHtp.dll" -c "session.disable_cpu_ep_fallback|1" models
264
+
.\accuracy_test -a results_o.csv -e qnn "backend_path|QnnHtp.dll" -c "session.disable_cpu_ep_fallback|1"--ep_model_name model.qdq.onnx models
0 commit comments