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

New version model conversion error #8

Open
psiydown opened this issue May 28, 2023 · 5 comments
Open

New version model conversion error #8

psiydown opened this issue May 28, 2023 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@psiydown
Copy link

psiydown commented May 28, 2023

New version model: https://storage.googleapis.com/mediapipe-assets/face_landmark.tflite
tflite2onnx face_landmark.tflite face_landmark.onnx
Error prompt:
Data type float16 not supported/tested yet, the generated model may contain error
Data type float16 not supported/tested yet, the generated model may contain error
Data type float16 not supported/tested yet, the generated model may contain error
Data type float16 not supported/tested yet, the generated model may contain error
Data type float16 not supported/tested yet, the generated model may contain error
Traceback (most recent call last):
File "N:\anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "N:\anaconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "N:\anaconda3\Scripts\tflite2onnx.exe_main
.py", line 7, in
File "N:\anaconda3\lib\site-packages\tflite2onnx\convert.py", line 58, in cmd_convert
convert(args.tflite_path, args.onnx_path)
File "N:\anaconda3\lib\site-packages\tflite2onnx\convert.py", line 44, in convert
model.convert(explicit_layouts)
File "N:\anaconda3\lib\site-packages\tflite2onnx\model.py", line 42, in convert
g.convert(explicit_layouts)
File "N:\anaconda3\lib\site-packages\tflite2onnx\graph.py", line 102, in convert
self._propagateLayout()
File "N:\anaconda3\lib\site-packages\tflite2onnx\graph.py", line 173, in _propagateLayout
t.transform()
File "N:\anaconda3\lib\site-packages\tflite2onnx\tensor.py", line 126, in transform
self.shape = self.layout.transform(self.shape)
File "N:\anaconda3\lib\site-packages\tflite2onnx\layout.py", line 27, in transform
output = transform(input, self.source, self.target)
File "N:\anaconda3\lib\site-packages\tflite2onnx\layout.py", line 16, in transform
transfrom_axis = [input[p] for p in perm]
File "N:\anaconda3\lib\site-packages\tflite2onnx\layout.py", line 16, in
transfrom_axis = [input[p] for p in perm]
IndexError: list index out of range

@keijiro Can you give me any help? Thank you

@keijiro keijiro self-assigned this May 28, 2023
@keijiro keijiro added the question Further information is requested label May 28, 2023
@keijiro
Copy link
Owner

keijiro commented May 28, 2023

That's basically an issue with tflite2onnx. Could you ask them first?

@psiydown
Copy link
Author

@keijiro I have already asked tflite2onnx but have not replied yet. Additionally, I have successfully converted onnx through another method:
python - m tf2onnx.convert --opset 9 --tflite face_Landmark.tflite --output face_Landmark.onnx
But there was an error running your Python script:

Traceback (most recent call last):
File "D:\python\scripts\1\face_landmark_barracuda.py", line 73, in
replace_pad_ops(model)
File "D:\python\scripts\1\face_landmark_barracuda.py", line 28, in replace_pad_ops
data = next(n for n in model.graph.value_info if n.name == node.input[0])
StopIteration

@keijiro
Copy link
Owner

keijiro commented May 29, 2023

Then how about using Colab instead of your local Python environment?

@psiydown
Copy link
Author

@keijiro I tried, it's not an environmental issue, the result is the same. Local use of old version face_landmark.onnx model is fine, but the new version cannot generate Barracuda after tf2onnx.convert.

@keijiro
Copy link
Owner

keijiro commented May 29, 2023

Thanks for the clarification. The model design (or its architecture) might be changed. I think you don't only need updating the Python script but also modifying the C# code. In other words, you can't try the new model with a quick hack.

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

No branches or pull requests

2 participants