Git Product home page Git Product logo

Comments (9)

pfeatherstone avatar pfeatherstone commented on July 21, 2024 3

ONNX export would be really useful. Unless there is a way of converting torchscript to ONNX.

from detr.

fmassa avatar fmassa commented on July 21, 2024

Hi,

Thanks for your request.
Adding support for torchscript was on our TODO list, so I've just sent a PR making the torchhub models support torchscript #51

We don't currently have plans to add support for ONNX though, but we would welcome PRs making it work (as long as the code still stays readable and simple to understand).

from detr.

ShubhamJain7 avatar ShubhamJain7 commented on July 21, 2024

@fmassa
Thanks for the link to your PR!
I'll look into adding ONNX support.

from detr.

zhiqwang avatar zhiqwang commented on July 21, 2024

The model detr_resnet50 can be converted into onnx, but its output is all nan, I tested NestedTensor in another project, its inference result in onnxruntime is also different compare to pytorch's. After removing NestedTensor, its result is equal to pytorch's. I guess the NestedTensor here cause this problem. Is there some suggestion to fix it?

from detr.

zhiqwang avatar zhiqwang commented on July 21, 2024

Hi all, I think I have fixes the above problem I mentioned. I retrieved the code in torchvision's faster-rcnn repo, and I found the purpose of this function is aimed at resolving this problem. My fix is here, I will test if it can help to resolve the onnx inference problem in DETR.

from detr.

zhiqwang avatar zhiqwang commented on July 21, 2024

Hi @fmassa

I take a quick fix of nested_tensor_from_tensor_list() according to the implementation of torchvision's to make it supported by ONNX tracing, Now the inference results in onnxruntime is consistent with pytorch. And here is my modification of _onnx_nested_tensor_from_tensor_list().

Can you check my modification, if it is OK, I would like to submit a PR :)

from detr.

fmassa avatar fmassa commented on July 21, 2024

@zhiqwang your implementation looks good, can you send a PR?

from detr.

zhiqwang avatar zhiqwang commented on July 21, 2024

Hi @fmassa , Of course, It's my pleasure.

from detr.

kopyl avatar kopyl commented on July 21, 2024

So it it supported now?

from detr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.