Giter Site home page Giter Site logo

DETRsegm to torchscript about detr HOT 1 OPEN

Mona77 avatar Mona77 commented on June 21, 2024
DETRsegm to torchscript

from detr.

Comments (1)

Zalways avatar Zalways commented on June 21, 2024

I have been able to successfully convert the DETR model into torchscript. But when I'm trying to convert my trained segmentation model DETRsegm I got the following error:

  File "/opt/conda/envs/torch_apps/lib/python3.8/site-packages/torch/jit/_recursive.py", line 393, in create_methods_and_properties_from_stubs
    concrete_type._create_methods_and_properties(property_defs, property_rcbs, method_defs, method_rcbs, method_defaults)
RuntimeError: 

forward(__torch__.models.transformer.___torch_mangle_644.Transformer self, Tensor src, Tensor mask, Tensor query_embed, Tensor pos_embed) -> ((Tensor, Tensor)):
Expected a value of type 'Tensor (inferred)' for argument 'mask' but instead found type 'Optional[Tensor]'.
Inferred 'mask' to be of type 'Tensor' because it was not annotated with an explicit type.
:
  File "/home/mona/platform/markerless-tracking/SemiSupervised_Seg/detr/models/segmentation.py", line 69
        src_proj = self.detr.input_proj(src)
    
        hs, memory = self.detr.transformer(
                     ~~~~~~~~~~~~~~~~~~~~~ <--- HERE
            src_proj, mask, self.detr.query_embed.weight, pos[-1]
        )

hi you said you export detr into torchscript successfully, i'd like to know your export code. do you use the detectron2's official export_model.py(https://github.com/facebookresearch/detectron2/blob/main/tools/deploy/export_model.py) to export the model?

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.