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

CAPI如何加载合并模型 #8883

Closed
yeyupiaoling opened this issue Mar 8, 2018 · 2 comments
Closed

CAPI如何加载合并模型 #8883

yeyupiaoling opened this issue Mar 8, 2018 · 2 comments
Assignees
Labels
User 用于标记用户问题

Comments

@yeyupiaoling
Copy link
Contributor

这里是介绍普通的加载模型的方法

long size;
void* buf = read_config(CONFIG_BIN, &size);
// Create the gradient machine for inference.
paddle_gradient_machine machine;
CHECK(paddle_gradient_machine_create_for_inference(&machine, buf, (int)size));
// Load the trained model. Modify the parameter MODEL_PATH to set the correct
// path of the trained model.
CHECK(paddle_gradient_machine_load_parameter_from_disk(machine, MODEL_PATH));

文档这也用说到下面一行代码是加载合并模型的,我看怎么跟上面的一样呢
https://github.com/PaddlePaddle/Mobile/blob/develop/Demo/linux/paddle_image_recognizer.cpp#L59

@ranqiu92 ranqiu92 added the User 用于标记用户问题 label Mar 8, 2018
@wangkuiyi
Copy link
Collaborator

这个问题和 #8885 相关。也请 @Xreki @kexinzhao 看看吧。

@yeyupiaoling
Copy link
Contributor Author

在Android上使用合并模型使用这个:

  // Step 1: Reading merged model.
  long size;
  void* buf = read_config(merged_model_path, &size);

  // Step 2:
  //    Create a gradient machine for inference.
  CHECK(paddle_gradient_machine_create_for_inference_with_parameters(
      &gradient_machine_, buf, size));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User 用于标记用户问题
Projects
None yet
Development

No branches or pull requests

5 participants