gpt4 book ai didi

android - 无法在android中构建caffe

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:47:19 26 4
gpt4 key购买 nike

我正在尝试创建一个 Android 应用程序,它可以识别图像中的对象并给出其名称作为结果。我知道 caffe-library 可以用于此,但是当我运行 ./build.py 时出现错误。

命令:

user_name@sysetm_name:~/caffe-android-lib$ ./build.py /bin/android-ndk-r10d/ndk-build

错误:

Traceback (most recent call last):
File "./build.py", line 102, in <module>
main(sys.argv[1:])
File "./build.py", line 94, in main
setup()
File "./build.py", line 24, in setup
call(['curl', '-O', PROTOBUF_URL])
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

最佳答案

确保克隆是递归的以包含依赖项:

*** caffe-android-lib Dependency:
Boost-for-Android
protobuf
Eigen

例如:

git clone --recursive https://github.com/sh1r0/caffe-android-lib.git
cd caffe-android-lib
./build.py $(NDK_PATH)

或者您是否尝试过从源代码安装依赖项(尤其是 protobuf)?

如果依赖项已正确安装,那么您将成功构建 caffe-android:

例如:

https://gist.github.com/melvincabatuan/6b5e37444b77326ae7b3
...updated 10980 targets...
Done!
...
[armeabi-v7a] Install : libcaffe_jni.so => libs/armeabi-v7a/libcaffe_jni.so

关于android - 无法在android中构建caffe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28958117/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com