Comments (2)
Rearranging our test a bit for debugging:
def test_varying_batch_sizes(self):
model = GradientBoostingClassifier(n_estimators=10, max_depth=3)
np.random.seed(0)
X = np.random.rand(100, 200)
X = np.array(X, dtype=np.float32)
y = np.random.randint(2, size=100)
X_test = np.random.rand(2, 200)
X_test = np.array(X_test, dtype=np.float32)
model.fit(X, y)
model_probs = model.predict_proba(X_test)
# failure is here on the HB convert line
# conv_model = hummingbird.ml.convert(model, "onnx", X, extra_config={})
The ORT team mentioned that there was a change to the transpose opset and that "the input shape seems missing".
When I run this code above, at the torch.onnx.export(
call in _topology.py, I get some warnings:
torch/onnx/utils.py:1702: UserWarning: The exported ONNX model failed ONNX shape inference. The model will not be executable by the ONNX Runtime. If this is unintended and you believe there is a bug, please report an issue at https://github.com/pytorch/pytorch/issues.
Error reported by strict ONNX shape inference: [ShapeInferenceError] Inference error(s): (op_type:Reshape, node name: /_operators.0/Reshape_4):
[ShapeInferenceError] Dimension could not be inferred: incompatible shapes
(op_type:ReduceSum, node name: /_operators.0/ReduceSum): [TypeInferenceError] Input 0 expected to have type but instead is null
(op_type:Add, node name: /_operators.0/Add): [TypeInferenceError] Input 0 expected to have type but instead is null
(op_type:Sigmoid, node name: /_operators.0/Sigmoid): [TypeInferenceError] Input 0 expected to have type but instead is null
(Triggered internally at ../torch/csrc/jit/serialization/export.cpp:1488.)
_C._check_onnx_proto(proto)
Maybe it does not like our dynamic_axes?
Which I guess explains the error message of ({
) which mean Null with the "[TypeInferenceError] Invalid attribute perm {1, 0}, input shape = {"
from hummingbird.
dynamic_axes_cfg in this test is {'input_0': {0: 'sym'}, 'variable': {0: 'sym'}}
.
If I remove the dynamic axes here (ex: ###dynamic_axes=dynamic_axes_cfg,
from torch.onnx.export
), and change my test code above to X_test = np.random.rand(100, 200)
(instead of (2, 200)
which won't work without dyn axes), it passes just fine.
from hummingbird.
Related Issues (20)
- 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
- FAILED tests/test_sklearn_bagging.py::TestSklearnBagging::test_bagging_logistic_regression - AssertionError HOT 2
- skl2onnx==1.17.0 breaks pipeline HOT 1
- backorder message after product into cart 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.