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

paddle配置IOS移动端时出现的配置问题 #5909

Closed
yukang2017 opened this issue Nov 25, 2017 · 9 comments
Closed

paddle配置IOS移动端时出现的配置问题 #5909

yukang2017 opened this issue Nov 25, 2017 · 9 comments
Assignees
Labels
iOS User 用于标记用户问题

Comments

@yukang2017
Copy link

您好,我编译的了IOS版的paddle(SIMULATOR,x86_64),所用命令如下。
cmake -DCMAKE_SYSTEM_NAME=iOS
-DIOS_PLATFORM=SIMULATOR
-DIOS_ARCH="x86_64"
-DIOS_USE_VECLIB_FOR_BLAS=ON
-DCMAKE_INSTALL_PREFIX=your/path/to/install
-DWITH_C_API=ON
-DWITH_TESTING=OFF
-DWITH_SWIG_PY=OFF
..

但是在按照 PaddlePaddle/Mobile#26 中的指导配置完后,遇到如下问题:

d: warning: ignoring file /Users/yukang/Desktop/code/Paddle-iOS-Demo/Paddle-iOS-Demo/third_party/libjpeg.a, missing required architecture x86_64 in file /Users/yukang/Desktop/code/Paddle-iOS-Demo/Paddle-iOS-Demo/third_party/libjpeg.a (2 slices)
Undefined symbols for architecture x86_64:
"paddle::simd::internal::batchAddToImpl(float*, float const**, int, unsigned long)", referenced from:
void paddle::CpuMatrix::mul<paddle::CacheRowCpuMatrix, paddle::CpuMatrix>(paddle::CpuSparseMatrix*, paddle::CacheRowCpuMatrix*, paddle::CpuMatrix*, float, float) in libpaddle_capi_whole.a(Matrix.cpp.o)
void paddle::CpuMatrix::mul<paddle::SparseRowCpuMatrix, paddle::CpuMatrix>(paddle::CpuSparseMatrix*, paddle::SparseRowCpuMatrix*, paddle::CpuMatrix*, float, float) in libpaddle_capi_whole.a(Matrix.cpp.o)
void paddle::CpuMatrix::mul<paddle::CpuMatrix, paddle::CpuMatrix>(paddle::CpuSparseMatrix*, paddle::CpuMatrix*, paddle::CpuMatrix*, float, float) in libpaddle_capi_whole.a(Matrix.cpp.o)
"paddle::simd::internal::addToImpl(float*, float const*, unsigned long)", referenced from:
paddle::CpuMatrix::addBias(paddle::Matrix&, float) in libpaddle_capi_whole.a(Matrix.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请问有什么办法能帮帮我吗?

@peterzhang2029 peterzhang2029 added mobile iOS User 用于标记用户问题 and removed mobile labels Nov 25, 2017
@yukang2017
Copy link
Author

补充一下,我试图运行的是,Paddle/Mobile/AICameraiOSDemo这个demo
https://github.com/PaddlePaddle/Mobile/tree/AICameraiOSDemo/Demo/iOS

@NHZlX NHZlX assigned hedaoyuan and Xreki and unassigned hedaoyuan Nov 27, 2017
@Xreki
Copy link
Contributor

Xreki commented Nov 27, 2017

@yukang2017 你好,

  1. 确认一下,你运行的是你自己的demo吧?Paddle/Mobile/AICameraiOSDemo应该不依赖libjpeg.a
    App中如何链接Paddle库请参考SSD Demo on Android and iOS Mobile#25 (comment)
  2. 可以尝试下编译真机版(OS,arm64)的库试下吗?Paddle/Mobile/AICameraiOSDemo之前都是跑的arm64的,确认下是不是x86_64的问题。

@yukang2017
Copy link
Author

@Xreki 谢谢您的回复。

  1. 上面贴的,这是我修改后的一个demo,不过和Paddle/Mobile/AICameraiOSDemo 这个demo的错误是一样的。

  2. 由于我手里还没有真机,等我有了再测试哈。

  3. 用模拟器 Paddle/Mobile/AICameraiOSDemo 测试时的完整错误是这样的:
    wechatimg1023

@Xreki
Copy link
Contributor

Xreki commented Nov 27, 2017

@yukang2017 谢谢你的测试。我们先排查下Paddle对x86_64的编译支持是否有问题吧。

@yukang2017
Copy link
Author

@Xreki 谢谢您的指导,我在真机上测试了,没有问题,效果和速度都还不错。
(测试的时候还需要vgg_ssd_net.paddle等几个模型,没有提供)

@Xreki
Copy link
Contributor

Xreki commented Nov 28, 2017

测试的时候还需要vgg_ssd_net.paddle等几个模型,没有提供

多谢您的尝试。vgg_ssd_net.paddle有下载地址,只是目前还没有正式文档说明,请参考https://github.com/Xreki/Mobile/tree/add_ssd_linux_demo/Demo/linux/ssd#download-merged-models-for-test ,另外几个模型后续会上传到服务器以供下载试用。

我在真机上测试了,没有问题。

这个看来应该确实是我们x86_64架构的库的编译问题,我们会尽快fix。

效果和速度都还不错

请问,您是用的什么模型测试的呢?

@yukang2017
Copy link
Author

就是用的这个vgg_ssd_net

@Xreki
Copy link
Contributor

Xreki commented Nov 28, 2017

明白啦。vgg_ssd_net这个模型精度不错的,但是模型结构太大,所以速度上有点慢,后续我们会放出上传mobilenet的模型,:smile:

@Xreki
Copy link
Contributor

Xreki commented Nov 30, 2017

@yukang2017 您好,已经提PR #6081 来Fix x86_64架构的链接问题了,多谢指出问题。

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

No branches or pull requests

4 participants