-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about input feature mapping #347
Comments
Tribuo needs to know what the mapping is from the feature names it produces to the feature indices that the ONNX model expects. If your model expects a feature vector (rather than an image or some other kind of structured input) then you need to pass in a For your example with a feature vector of |
Yes @Craigacp, the 2 is a batch. So it really needs a float array with 7 elements as input. |
Ok, so you'd want to make a Tribuo example containing those 7 features, with appropriate names. Those can be semantic ones if the features actually have names, or just |
okay, but what about the key "input" do I not need that in tribuo? |
Oh I see. And at inference time what should be the format of my input? What type of object and what function should I be using to run inference on the Model object? @Craigacp |
The model exposes a |
Any code example which shows how to build an Example object from raw values? |
Not specifically, but you can see how the examples are built in all the |
Ask the question
I am trying to use a onnx model trained in python to run inference on with tribe. I was providing the input to my onnx model in the following format:
float[][] sourceArray = new float[2][7];
for (int i=0; i < 2; i++){
for (int j=0; j < 7; j++) sourceArray[i][j] = 1.0f;
}
OnnxTensor tensor = OnnxTensor.createTensor(env,sourceArray);
Map<String, OnnxTensor> inputs = new HashMap();
inputs.put("input",tensor);
what is the best way in tribuo to do the same? I checked this tutorial (https://tribuo.org/learn/4.3/tutorials/external-models-tribuo-v4.html#Loading-in-an-ONNX-model) but I am not sure how to structure my feature mapping.
Is your question about a specific ML algorithm or approach?
No
Is your question about a specific Tribuo class?
No
System details
Additional context
Add any other context or screenshots about the question
The text was updated successfully, but these errors were encountered: