PINTO0309 / openvino2tensorflow

This script converts the ONNX/OpenVINO IR model to Tensorflow's saved_model, tflite, h5, tfjs, tftrt(TensorRT), CoreML, EdgeTPU, ONNX and pb. PyTorch (NCHW) -> ONNX (NCHW) -> OpenVINO (NCHW) -> openvino2tensorflow -> Tensorflow/Keras (NHWC/NCHW) -> TFLite (NHWC/NCHW). And the conversion from .pb to saved_model and from saved_model to .pb and from .pb to .tflite and saved_model to .tflite and saved_model to onnx. Support for building environments with Docker. It is possible to directly access the host PC GUI and the camera to verify the operation. NVIDIA GPU (dGPU) support. Intel iHD GPU (iGPU) support.
MIT License
334 stars 40 forks source link

ScatterUpdate node issue #131

Closed hayoyo12 closed 1 year ago

hayoyo12 commented 1 year ago

Issue Type

Others

OS

Ubuntu

OS architecture

x86_64

Programming Language

Python

Framework

OpenVINO, ONNX, TensorFlow, TensorFlowLite

Download URL for ONNX / OpenVINO IR

*

Convert Script

openvino2tensorflow --model_path pose3d.xml --model_output_path PATH --output_saved_model --output_pb --weight_replacement_config replacement.json

Description

Hi, I tried to convert onnx -> openvino -> tensorflow model using your openvino2tensorflow. I had trouble before with pip install, so I tried to use your docker images for this time.

I already convert onnx model to openvino, and now trying to convert openvino to tensorflow model.

I am working with our company's source code, so I cannot open full codes at here :(, but I tried to bring captured images from error and xml(openvino ir) node tree.

I tried to fix using weight replacement json, but it did not work with this error and I cannot understand the meaning of the error.

Please help me :'(..

If I need to check 'Please refer to 6-7 in the README first. https://github.com/PINTO0309/openvino2tensorflow' Then please let me know a specific number of line or anything :( I tried to fix with: { "layer_id": "12", "type": "Const", "replace_mode": "direct", "values": [ 0 ] }, { "layer_id": "11", "type": "Const", "replace_mode": "direct", "values": [ 12, 256, 25 ] }

Thank you!! error1 xml_tree

Relevant Log Output

====================================================================================
WARNING: TensorFlow's ScatterUpdate ignores axis, which may result in incorrect processing results. layer_id: 24, axis: [0]
ERROR: {{function_node __wrapped__ResourceScatterUpdate_device_/job:localhost/replica:0/task:0/device:CPU:0}} Must have updates.shape = indices.shape + params.shape[1:] or updates.shape = [], got updates.shape [1,1], indices.shape [1], params.shape [3] [Op:ResourceScatterUpdate]
ERROR: model_path  : pose3d/models/fusedPose3d.xml
ERROR: weights_path: pose3d/models/fusedPose3d.bin
ERROR: layer_id    : 24
ERROR: input_layer0 layer_id=11: Const(ndarray).shape  (3,)
array([ 12, 256,  25])
ERROR: input_layer1 layer_id=12: Const(ndarray).shape  (1,)
array([2])
ERROR: input_layer2 layer_id=22: tf.Tensor([[256]], shape=(1, 1), dtype=int64)
ERROR: input_layer3 layer_id=23: Const(ndarray).shape  (1,)
array([0])
ERROR: The trace log is below.
Traceback (most recent call last):
  File "/usr/local/bin/openvino2tensorflow", line 6999, in convert
    tf_layers_dict[layer_id] = tf.compat.v1.scatter_update(
  File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/ops/state_ops.py", line 431, in scatter_update
    return ref._lazy_read(gen_resource_variable_ops.resource_scatter_update(  # pylint: disable=protected-access
  File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/ops/gen_resource_variable_ops.py", line 1175, in resource_scatter_update
    _ops.raise_from_not_ok_status(e, name)
  File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/ops.py", line 7209, in raise_from_not_ok_status
    raise core._status_to_exception(e) from None  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__ResourceScatterUpdate_device_/job:localhost/replica:0/task:0/device:CPU:0}} Must have updates.shape = indices.shape + params.shape[1:] or updates.shape = [], got updates.shape [1,1], indices.shape [1], params.shape [3] [Op:ResourceScatterUpdate]
ERROR: Please refer to 6-7 in the README first. https://github.com/PINTO0309/openvino2tensorflow

Source code for simple inference testing code

No response

PINTO0309 commented 1 year ago

Too little information. Answer cannot.