Comments (4)
Thank you:)
Do you want to load the parameters in C++?
I think you can try the function
static void Load(const std::string &file_name,
std::vector<NDArray> *array_list = nullptr,
std::map<std::string, NDArray> *array_map = nullptr);
or
MXNET_DLL int MXNDArrayLoad(const char* fname,
mx_uint *out_size,
NDArrayHandle** out_arr,
mx_uint *out_name_size,
const char*** out_names);
in $MXNET_HOME/cpp-package/include/mxnet-cpp/ndarray.h and $MXNET_HOME/include/mxnet/c_api.h.
And there are some examples to use the functions.(https://github.com/apache/incubator-mxnet/blob/master/cpp-package/example/feature_extract/feature_extract.cpp
https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/ndarray/utils.py)
from mobulaop.
Thanks, I want to load the symbol and parameters in C++. But the model use a custom operator. MXNet C++ has no the operator, so I can't load the json file.
from mobulaop.
@nuaawzl
I found MXSymbolCreateFromFile is used to load all symbols, including Custom Operator.
And the custom operator is registered in python/mxnet/operator.py.
I think it may be a solution.
- get creator_func of the custom operator in Python. Cython may be useful.
- use MXCustomOpRegister to register the custom operator in C++
- use MXSymbolCreateFromFile to load all symbols in C++
from mobulaop.
Thank you very much. I coded the new operator and recompiled mxnet. I'll try your advice.
from mobulaop.
Related Issues (20)
- Does these operators respect the asynchronous execution in MXNet? HOT 7
- Not working with MXNet nightly build (1.5.0b20181222) HOT 6
- Lack of comments HOT 2
- [Question] Using types other than float32? HOT 10
- Does it work if custom op and the framework are compiled with different version of GCC? HOT 1
- ROIAlign custom op runs slowly HOT 13
- [Feature request] Gradient check HOT 4
- LICENSE Problem
- Low performance in gpu mode HOT 4
- Not working with multiple processes HOT 13
- Leveraging framework specific math helpers HOT 1
- Build Failed in GCC5. Incomplete type Error. HOT 1
- Question on Example on PyTorch HOT 4
- Question on ATTEN SAMPLER based on MobulaOP HOT 3
- The crash when training model on multiple GPUs HOT 1
- compile error HOT 5
- Is MobulaOP support cupy? HOT 2
- Custom Operators Zoo HOT 1
- undefined symbol: MXShallowCopyNDArray HOT 2
- Implementation ideas of creating Operator HOT 6
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 mobulaop.