Giter VIP home page Giter VIP logo

Comments (4)

ksaur avatar ksaur commented on June 11, 2024

Hi @jamespinkerton, Can you please post the error here?

We provide the save/load functions which work to serialize any model (including torchscript), but if I understand correctly this won't work for your use case as you need to deserialize it in a non-python environment? I wonder if any of that save/load torch jit code would be at all useful in some other way (the logic translated to some other language)?

from hummingbird.

interesaaat avatar interesaaat commented on June 11, 2024

To add to what Karla said, if you are calling torch.jit.script on an Hummingbird model it won't work. But we provide already that functionality for you: you can compile your model by passing torch.jit as backed and then save it as Karla said and you should be ok (assuming you manually deserialize the model on the C++ side following our loading code as Karla already suggested). Example on how to generate torchscript models from Hummingbird are here.

from hummingbird.

jamespinkerton avatar jamespinkerton commented on June 11, 2024

This is a great answer, but I don't think it quite answers my question. When I use a modeling package to solve a real-world problem, I usually need to surround it with other things. In this case, I surround it with a torch model. Think of that as preprocessing and postprocessing that occur before and after LGBM.

So fundamentally I need to be able to compose operations. I also need to be able to move the model into torchscript. Based on your answer, I don't see how I could do both at once. If I compose pytorch and hummingbird I can't later move to torchscript. If I compile hummingbird to torchscript first, I don't see how to compose it with other things in pytorch (which themselves have to be put in torchscript too).

from hummingbird.

interesaaat avatar interesaaat commented on June 11, 2024

Ok got it. Have you tried with torch.jit.trace instead of script? That is what we are using internally so maybe it will also work in your case?

from hummingbird.

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.