Skip to content
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 sequence/map input onnx type from model #1747

Closed
qw2208 opened this issue Sep 2, 2019 · 10 comments
Closed

Question about sequence/map input onnx type from model #1747

qw2208 opened this issue Sep 2, 2019 · 10 comments
Labels
feature request request for unsupported feature or enhancement

Comments

@qw2208
Copy link

qw2208 commented Sep 2, 2019

  1. Is there a way to get the non-tensor types from the onnx model?
    For example, if the model input is of type: std::vector<std::map<int64_t, float>>, I could get the input type of ONNX_TYPE_SEQUENCE by running session->GetInputTypeInfo(i).GetONNXType();
    However, I'm confused how I could continue to get the type of the map while creating Ort::Value using the CXX api?
  2. Another question is when loading the Bert model from Bert_model, one of the input shapes is [-1, 256] (Actually this model converted from Tensorflow and the inputs shape all starts with -1). Is the negative index supported when calling session run function? I'm getting the error of out of data bound.
    image
@snnn
Copy link
Member

snnn commented Sep 4, 2019

I'll take a look at the second one. It shouldn't be [-1].

@snnn
Copy link
Member

snnn commented Sep 5, 2019

For you question two: here the -1 means unknown. You can replace it with any non-zero positive value.

@qw2208
Copy link
Author

qw2208 commented Sep 5, 2019

Yes, I did replace the -1 with 1 to all of the four inputs while getting the element out-of-bound exception as shown in the screen shot.

@snnn
Copy link
Member

snnn commented Sep 5, 2019

We'll update the model.

@faxu faxu added the question label Sep 10, 2019
@RyanUnderhill
Copy link
Member

For 1. I'm not sure what you mean by continuing to get the type of the map. If you have an Ort::Value you can still call GetTypeInfo() on it and then call GetONNXType() the same as before?

@qw2208
Copy link
Author

qw2208 commented Sep 12, 2019

@RyanUnderhill Thanks Ryan. However, for inputs, I will not get it in Ort::Value and the GetTypeInfo() could only get the type of the outer type.

@RyanUnderhill
Copy link
Member

@qw2208 Ah, I see what you're looking for. Yeah, currently we have no way to query subtype information of a type. I'm marking this as an enhancement as we'd need some extra interface functions like this:

OrtStatus* GetType(const OrtTypeInfo type, int index, OrtTypeInfo** out)
OrtStatus* GetTypeCount(const OrtTypeInfo type, int index, size_t* out);

@RyanUnderhill RyanUnderhill added the feature request request for unsupported feature or enhancement label Sep 25, 2019
@faxu faxu removed the question label Oct 11, 2019
@faxu
Copy link
Contributor

faxu commented Mar 10, 2020

First issue is resolved - available in ORT 1.2.

@vinitra can you take a look at #2 and see if the model zoo model still needs updates?

@stale
Copy link

stale bot commented Jul 18, 2020

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@stale stale bot added the wontfix label Jul 18, 2020
@stale
Copy link

stale bot commented Jul 25, 2020

This issue has been automatically closed due to inactivity. Please reactivate if further support is needed.

@stale stale bot closed this as completed Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants