Comments (4)
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.
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.
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.
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)
- New LGBM Version 4.0.0 changes HOT 2
- TVM + Mac HOT 3
- Performing simple inference HOT 3
- XGBoost 2.0.0 breaks tests HOT 8
- Example cases for DecisionTreeClassifier HOT 2
- onnxruntime==1.16.0 release breaks tests HOT 3
- if i have saved a pytorch_based model, i want to run inference on cpu, how to change the codes? HOT 5
- Adding more ONNX data types
- ONNXMLGather breaks tests HOT 2
- Support for sklearn training HOT 1
- Github Actions changes
- SKL 1.4 release breaks build HOT 3
- coredumps on Ubuntu pipeline runs HOT 2
- Documentation deploy problem
- Need to update setup.py description
- Is "Hummingbird" trademarked? HOT 3
- [Tracking Issue] Upgrade Apache TVM to v0.16.0
- onnxruntime.capi.onnxruntime_pybind11_state.Fail ONNXRuntimeError HOT 2
- FAILED tests/test_sklearn_bagging.py::TestSklearnBagging::test_bagging_logistic_regression - AssertionError HOT 2
- skl2onnx==1.17.0 breaks pipeline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hummingbird.