-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
使用C-API,链接libpaddle_capi_whole.a
库,运行的时候遇到UnKnown class type: data
#2863
Comments
@fingthinking |
@hedaoyuan 我按照你的回复,在BCLOUD中添加了参数, |
可以看一下最终的链接参数是否生成了 |
@fingthinking 可以解决问题吗? |
@hedaoyuan 现在有点其他事,如果解决了,我会在issue中说,谢谢 |
@hedaoyuan |
你把 |
@fingthinking |
libpaddle_capi_whole.a
库,运行的时候遇到UnKnown class type: data
@hedaoyuan |
你第一个comment中的代码没有贴全,是按照这个方式写的吗? |
char* argv[] = {(char*)"--use_gpu=False"};
// init paddle
CHECK(paddle_init(1, (char**)argv));
long size=-1;
void* buf = cpu::ci::read_config(this->_config_bin_str, &size);
std::cout<<"size:-----"<<size<<std::endl;
paddle_gradient_machine machine;
// Create a gradient machine for inference.
CHECK(paddle_gradient_machine_create_for_inference(&machine, buf, (int) size));
CHECK(paddle_gradient_machine_load_parameter_from_disk(machine, this->_param_str)); 这种方式调用的,到create_for_inference函数中就挂了 |
|
在这段code之前有调用 |
@hedaoyuan 在paddle_init里面会调用google::gflags::ParseCommandLineFlags |
paddle_init里面会调用。但你现在是在paddle_gradient_machine_create_for_inference里面报错? |
@hedaoyuan 情况是,如果使用so库,则在paddle_init中就会报错了,但是如果使用whole.a,则init是正确了,但是到了paddle_gradient_machine_create_for_inference又报错了。也是比较无奈。 |
whole.a的错误是前面说的 |
@hedaoyuan 好的,我纯粹的使用demo的例子试试能不能运行了,不使用公司的环境。 |
嗯,自己编译例子里的demo试一下。一条编译命令就够了。 |
在使用公司发布的capi静态库版本:
![image](https://user-images.githubusercontent.com/5517388/28201130-302124e6-68a2-11e7-8b05-c82181a3caf1.png)
![image](https://user-images.githubusercontent.com/5517388/28201169-616061fc-68a2-11e7-9b2b-0d3cd10618d2.png)
![image](https://user-images.githubusercontent.com/5517388/28201203-859c5d1e-68a2-11e7-8c77-c18743494390.png)
中的libpaddle_capi_whole.a进行编译的时候;
在使用
machine_create_for_inference方法的时候
遇到了UnKnow class type: data的问题:F0714 15:02:00.653980 30167 ClassRegistrar.h:65] Check failed: mapGet(type, creatorMap_, &creator) Unknown class type: data
其中config的配置文件Json格式片段如下:
type:data在capi中无法使用,请问这种情况如何解决?
The text was updated successfully, but these errors were encountered: