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

[BUG] Can't convert segformer ONNX Model to Blob Files #861

Open
yuchenlichuck opened this issue Dec 5, 2022 · 7 comments
Open

[BUG] Can't convert segformer ONNX Model to Blob Files #861

yuchenlichuck opened this issue Dec 5, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@yuchenlichuck
Copy link

Check if issue already exists

  • Google it (e.g. error xy github luxonis depthai)
  • Check troubleshooting in documentation.

Describe the bug
A clear and concise description of what the bug is.

Minimal Reproducible Example
Append the MRE to the bug report, instructions here

Expected behavior
I tried to convert segformer onnx model to blob files in http://blobconverter.luxonis.com/.
But I failed many times and there is no error output. Could you help me know what is wrong with it? Thank you.

Screenshots
image

Pipeline Graph

Please also provide a screenshot of your pipeline using the DepthAI Pipeline Graph.

Attach system log

Additional context
Add any other context about the problem here.

@yuchenlichuck yuchenlichuck added the bug Something isn't working label Dec 5, 2022
@brmarkus
Copy link

brmarkus commented Dec 6, 2022

Can you provide a pointer to where to get exactly the same model you tried to convert/compile, please? Is this an "original" model, or your model, have you changed the model?
Have you tried converting/compiling other models - just for consistency-check if the environment is installed properly, the model fitting (like supported OPS-level, etc.)?

@Erol444 Erol444 changed the title [BUG] {Can't convert segformer ONNX Model to Blob Files} [BUG] Can't convert segformer ONNX Model to Blob Files Dec 6, 2022
@Erol444
Copy link
Member

Erol444 commented Dec 6, 2022

@Erol444
Copy link
Member

Erol444 commented Dec 6, 2022

@yuchenlichuck as Markus requested, please also share model repo, and how/where you got the onnx.

@yuchenlichuck
Copy link
Author

I got the model from Hugging face segments-tobias/segformer-b0-finetuned-segments-sidewalk

from transformers import AutoFeatureExtractor, SegformerForSemanticSegmentation
model = SegformerForSemanticSegmentation.from_pretrained("segments-tobias/segformer-b0-finetuned-segments-sidewalk")

then I use pytorch onnx to generate the onnx files.

import torch
dummy_input = torch.rand(1, 3, IMAGE_HEIGHT, IMAGE_WIDTH)


torch.onnx.export(
    model,
    dummy_input,
    onnx_path,
    opset_version=11,
    do_constant_folding=False,
)

@Erol444
Copy link
Member

Erol444 commented Dec 6, 2022

@tersekmatija could someone from ML team quickly evaluate whether this would be possible?
Thanks!

@tersekmatija
Copy link
Contributor

I've tried quickly exporting this locally with the latest API and it seems that the compiler gets stuck. No error or anything, it just times out. I would suggest opening and issue on OpenVINO GitHub and linking it here. From what I've observed, transformers are not really optimized for MyriadX.

@yuchenlichuck
Copy link
Author

Okay, thank you for sharing this information with me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants