Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Example of RNN (incl. GRU/LSTM) with APIs defined in c_predict_api.h #12734

Closed
Isa-rentacs opened this issue Oct 4, 2018 · 13 comments
Closed

Comments

@Isa-rentacs
Copy link

Description

With MXNet 1.3.0, RNN layers can be hybridized. I would like to use those hybridized RNN models from C-api (c_predict_api.h) but couldn't find an example.

More details

I was looking at an issue (How to use LSTM or GRU in C++ using c_predict_api.h?) and in the answer:

@xiaogehh currently the Gluon LSTM and GRU RNN layers cannot be hybridized but the work towards should be soon completed. You can track the effort here: #10873

I believe it's released as a part of MXNet 1.3.0, and now I would like to know how to use them from C++.
If we can have something like the one for CNN it would be very helpful.

@marcoabreu
Copy link
Contributor

FYI: All C-APIs are considered internal APIs that don't follow semantic versioning. They are not intended for external use since they might change at any point in time. We got the Cpp-package which is enduser-facing, so this might rather be a feature request for the C++ package.

@Isa-rentacs
Copy link
Author

Thank you @marcoabreu for your answer. Does it mean at this moment loading hybridized RNN models from C++ API is not supported?

@vrakesh
Copy link
Contributor

vrakesh commented Oct 4, 2018

@mxnet-label-bot [Feature request]

@marcoabreu
Copy link
Contributor

Sorry, I'm not familiar with the c API.

@lebeg @leleamol might be able to answer that question

@Isa-rentacs Isa-rentacs changed the title Example of RNN (incl. GRU/LSTM) from c_predict_api.h Example of RNN (incl. GRU/LSTM) with APIs defined in c_predict_api.h Oct 5, 2018
@eric-haibin-lin eric-haibin-lin added C++ Related to C++ C API labels Oct 5, 2018
@lebeg
Copy link
Contributor

lebeg commented Oct 8, 2018

@Isa-rentacs In my understanding the implemented RNN layer is implemented in python, so there would be no option to access it from the C API. Maybe this could be a feature request.

@Isa-rentacs
Copy link
Author

Thanks @lebeg, I understood this is going to be a feature request. Before going forward, I would like to understand a little bit more.

In the 1.3.0 release note, it says:

Now many dynamic networks that are based on Gluon RNN layers can now be completely hybridized, exported, and used in the inference APIs in other language bindings such as R, Scala, etc.

Do you mean C/C++ is not included in the languages that can import the exported model?

@lebeg
Copy link
Contributor

lebeg commented Oct 9, 2018

@Isa-rentacs I'm afraid I don't know the answer. Maybe @szha can help on this?

@leleamol
Copy link
Contributor

@Isa-rentacs The C++ API in cpp-package support methods to load the trained models and parameters.
I have written an example to load a CNN model as mentioned in this PR #12930

Based on issue description, I am inferring that you are planning to use C++ API for inference. Will you be able to share your use case?

@leleamol
Copy link
Contributor

leleamol commented Jan 4, 2019

@Isa-rentacs I have submitted the PR #13680 that demonstrates the usage of C++ API in running the inference on RNN models.

The C API are the internal APIs and are not meant for external consumption.

@leleamol
Copy link
Contributor

leleamol commented Jan 4, 2019

@mxnet-label-bot add [Pending Requester Info]

@Isa-rentacs
Copy link
Author

Hi @leleamol, thank you for working on this, I've added several comments to your PR.

@leleamol
Copy link
Contributor

The example is merged and available in the master. This issue can be closed.

@lanking520
Copy link
Member

@Isa-rentacs As explained the PR merged, let's close this issue for now. Please feel free to reopen this thread if you observed more problems with that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants