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

How to save a learned network in C++ API #6726

Closed
Bumblebee1964 opened this issue Jun 16, 2017 · 4 comments
Closed

How to save a learned network in C++ API #6726

Bumblebee1964 opened this issue Jun 16, 2017 · 4 comments

Comments

@Bumblebee1964
Copy link

For bugs or installation issues, please provide the following information.
The more information you provide, the more likely people will be able to help you.

Environment info

Operating System:Win10

Compiler:VS2015

Package used (Python/R/Scala/Julia):

MXNet version:

Or if installed from source:

MXNet commit hash (git rev-parse HEAD):

If you are using python package, please provide

Python version and distribution:

If you are using R package, please provide

R sessionInfo():

Error Message:

I learn my network with c++ API. I wan to use the "Predict" C++ API, but it requires I save the network in json format. How can I do that in c++ API? Has anyone an example?

Minimum reproducible example

if you are using your own code, please provide a short script that reproduces the error.

Steps to reproduce

or if you are running standard examples, please provide the commands you have run that lead to the error.

What have you tried to solve it?

@conopt
Copy link
Contributor

conopt commented Jun 23, 2017

Use NDArray::Save(https://github.com/dmlc/mxnet/blob/master/cpp-package/include/mxnet-cpp/ndarray.h#L386) to save your arg map and load it using NDArray::Load

@Bumblebee1964
Copy link
Author

Thanks for your reply, very helpful. I will try it soon. Is there also a simple function to write the structure of the network to a json file?

@conopt
Copy link
Contributor

conopt commented Jun 26, 2017

@Bumblebee1964
Copy link
Author

Great, seams to solve my required functionality:)

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

No branches or pull requests

2 participants