Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int(self.shape[i]//inputs.shape[i]) > 1报错IndexError: tuple index out of range #77

Open
TuHaiqing opened this issue Jul 27, 2024 · 0 comments

Comments

@TuHaiqing
Copy link

请教,在onnx转tflite过程中,发生报错,报错信息如下,请问是哪里发生的错误,该如何解决?谢谢

python -m onnx2tflite --weights "./model.onnx"
2024-07-27 17:53:05.420513: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Checking 0/1...
2024-07-27 17:53:06.077872: I tensorflow/core/common_runtime/process_util.cc:146] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/tuhaiqing/1_Projects/onnx2tflite/onnx2tflite/main.py", line 41, in
run()
File "/home/tuhaiqing/1_Projects/onnx2tflite/onnx2tflite/main.py", line 24, in run
onnx_converter(
File "/home/tuhaiqing/1_Projects/onnx2tflite/onnx2tflite/converter.py", line 44, in onnx_converter
keras_model, input_layout, output_layout = keras_builder(model_proto, native_groupconv)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tuhaiqing/1_Projects/onnx2tflite/onnx2tflite/components/builder.py", line 53, in keras_builder
res = tf_operator(tf_tensor, onnx_weights, node_inputs, op_attr, node_outputs, layout_dict)(_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tuhaiqing/1_Projects/onnx2tflite/onnx2tflite/layers/deformation_layers.py", line 200, in call
if int(self.shape[i]//inputs.shape[i]) > 1:
~~~~~~~~~~~~^^^
File "/opt/anaconda3/envs/onnx2tfllite/lib/python3.11/site-packages/tensorflow/python/framework/tensor_shape.py", line 957, in getitem
return self._dims[key]
~~~~~~~~~~^^^^^
IndexError: tuple index out of range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant