From 6e254b38772164a5e09b76f6d1cbf75aef3b6353 Mon Sep 17 00:00:00 2001 From: on-jungwoan Date: Tue, 11 Apr 2023 13:07:38 +0900 Subject: [PATCH 1/2] Update README.md about cind option --- README.md | 7 +++++++ onnx2tf/ops/GridSample.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0e83f45..7feb645a 100644 --- a/README.md +++ b/README.md @@ -363,6 +363,8 @@ Perform error checking of ONNX output and TensorFlow output. Verify that the err `-ois` an option to overwrite the input OP to a static size if it has undefined dimensions. `-cotof` option checks the accuracy of all OPs one by one. `-cotoa` is the error value of the threshold for determining an accuracy error. If there are undefined dimensions in the input OP, it is better to fix them to the static geometry to improve the accuracy of the accuracy measurement. +Also, you can use the `-cind` option to specify custom input for `-cotof`, instead of using the default dummy input. Otherwise, all input values will be set to 1. For more information about the `-cind` option, please refer to [here](#cli-parameter). + The `-cotof` option only compares the original ONNX and converted TensorFlow (Keras) models at Float32 precision, not at Float16 or INT8 precision. ``` @@ -371,6 +373,10 @@ $ onnx2tf -i mobilenetv2-12.onnx -ois input:1,3,224,224 -cotof -cotoa 1e-1 or $ onnx2tf -i mobilenetv2-12.onnx -b 1 -cotof -cotoa 1e-1 + +or + +$ onnx2tf -i mobilenetv2-12.onnx -cotof -cotoa 1e-1 -cind input /your/path/x.npy ``` ![image](https://user-images.githubusercontent.com/33194443/216901668-5fdb1e38-8670-46a4-b4b9-8a774fa7545e.png) @@ -1954,3 +1960,4 @@ The above differences often cannot be dealt with by simply converting the model Made with [contrib.rocks](https://contrib.rocks). + diff --git a/onnx2tf/ops/GridSample.py b/onnx2tf/ops/GridSample.py index 3441f9ef..be1bac74 100644 --- a/onnx2tf/ops/GridSample.py +++ b/onnx2tf/ops/GridSample.py @@ -449,7 +449,7 @@ def make_node( make_tf_node_info( node_info={ 'tf_op_type': 'GridSample', - 'tf_inputs': { + 'tf_inputs': { 'image': image, 'grid': grid, 'align_corners': align_corners, From a6b1c31ccc811effa73a17bf25f5b28e7f39f685 Mon Sep 17 00:00:00 2001 From: on-jungwoan Date: Tue, 11 Apr 2023 13:14:18 +0900 Subject: [PATCH 2/2] Fix typo --- README.md | 1 - onnx2tf/ops/GridSample.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7feb645a..4ddf6c56 100644 --- a/README.md +++ b/README.md @@ -1960,4 +1960,3 @@ The above differences often cannot be dealt with by simply converting the model Made with [contrib.rocks](https://contrib.rocks). - diff --git a/onnx2tf/ops/GridSample.py b/onnx2tf/ops/GridSample.py index be1bac74..3441f9ef 100644 --- a/onnx2tf/ops/GridSample.py +++ b/onnx2tf/ops/GridSample.py @@ -449,7 +449,7 @@ def make_node( make_tf_node_info( node_info={ 'tf_op_type': 'GridSample', - 'tf_inputs': { + 'tf_inputs': { 'image': image, 'grid': grid, 'align_corners': align_corners,