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
I wrapped the single operator AdjustContrastv2 in tensorflow 2.11 as a model and saved it as a frozen pb model file. At the same time I transformed the tf model by tf2onnx to get the onnx model, and the two have inconsistent results with large errors for the same input parameters.
Urgency
System information
OS Platform and Distribution (e.g., Linux Ubuntu 18.04*): Ubuntu 20.04.5 LTS
TensorFlow Version: 2.11.0.dev
Python version: 3.8.10
ONNX version (if applicable, e.g. 1.11*): 1.12.0
ONNXRuntime version (if applicable, e.g. 1.11*): 1.12.1
To Reproduce
The link shows the two models before(tf.raw_ops.AdjustContrastv2_frozen_graph.pb) and after(tf.raw_ops.AdjustContrastv2_model.onnx) the conversion, and the two input parameters of the model(images.npy and contrast_factor.npy). The tf_save_model dir is the model saved using tf.saved_model.save.
The following code is running two models separately, feeding them the same input, but with inconsistent results.
2023-01-08 23:20:23.909106: I tensorflow/core/grappler/clusters/single_machine.cc:358] Starting new session
2023-01-08 23:20:23,919 - INFO - Using tensorflow=2.11.0.dev20220905, onnx=1.12.0, tf2onnx=1.12.1/b6d590
2023-01-08 23:20:23,920 - INFO - Using opset <onnx, 17>
2023-01-08 23:20:23,921 - INFO - Computed 0 values for constant folding
2023-01-08 23:20:23,925 - INFO - Optimizing ONNX model
2023-01-08 23:20:23,937 - INFO - After optimization: Identity -2 (2->0)
2023-01-08 23:20:23,938 - INFO -
2023-01-08 23:20:23,938 - INFO - Successfully converted TensorFlow model onnx_test/tf_model/ to ONNX
2023-01-08 23:20:23,938 - INFO - Model inputs: ['args_0', 'args_1']
2023-01-08 23:20:23,938 - INFO - Model outputs: ['output_0']
2023-01-08 23:20:23,938 - INFO - ONNX model is saved at xxxx/tf.raw_ops.AdjustContrastv2_model.onnx
Describe the bug
I wrapped the single operator
AdjustContrastv2
in tensorflow 2.11 as a model and saved it as a frozen pb model file. At the same time I transformed the tf model by tf2onnx to get the onnx model, and the two have inconsistent results with large errors for the same input parameters.Urgency
System information
To Reproduce
The link shows the two models before(
tf.raw_ops.AdjustContrastv2_frozen_graph.pb
) and after(tf.raw_ops.AdjustContrastv2_model.onnx
) the conversion, and the two input parameters of the model(images.npy
andcontrast_factor.npy
). Thetf_save_model
dir is the model saved usingtf.saved_model.save
.The following code is running two models separately, feeding them the same input, but with inconsistent results.
Here are the results:
The commands for model conversion is:
python -m tf2onnx.convert --saved-model {saved_tf_model_dir} --output {saved_onnx_model_path} --opset 17
The conversion log is:
Screenshots
Tensorflow
tf.raw_ops.AdjustContrastv2_frozen_graph.pb
:ONNX
tf.raw_ops.AdjustContrastv2_model.onnx
:Additional context
The text was updated successfully, but these errors were encountered: