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

关于模型的优化 #39

Closed
noiplcx opened this issue Jul 26, 2017 · 9 comments
Closed

关于模型的优化 #39

noiplcx opened this issue Jul 26, 2017 · 9 comments

Comments

@noiplcx
Copy link

noiplcx commented Jul 26, 2017

刚才终于编译好 so文件了 但是我放android里面运行 时间消耗居然有4s
前段时间 用caffe测试是2.5s
我想请教一下 转android项目的具体流程 看看是不是遗漏了什么步骤

@nihui
Copy link
Member

nihui commented Jul 26, 2017

检查下编译 libncnn.a 的时候是否有编译 arm 目录里的代码

@noiplcx
Copy link
Author

noiplcx commented Jul 26, 2017

怎么检查啊
我是用下面的代码编译的
export ANDROID_NDK=/absolute/path/to/the/android-ndk
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..
make -j8
make install

@nihui
Copy link
Member

nihui commented Jul 26, 2017

检查生成的 layer_declaration.h 里头是不是有 xxx_arm 的那种

@noiplcx
Copy link
Author

noiplcx commented Jul 27, 2017

caffe2ncnn设置quantize_level == 256后 用转化后的模型app蹦掉
我想请问下 设置quantize_level的具体流程 这个设置能降低运算量 提升运行速度么

@nihui
Copy link
Member

nihui commented Jul 27, 2017

quantize_level 256 只能降低模型大小,不能提升运行速度,而且会降低效果
用 65536 会平衡些,然而也只能降低模型大小,不能提升运行速度 :)

@litingsjj
Copy link

@nihui 你好,我编译libncnn.a已经编译了arm目录下代码,也看到了layer_declaration.h 里的 xxx_arm ,但是我用mobilenetV2测的时候耗时5s多,而且跟原来不用neon耗时差不多,请问这是怎么回事?

@KeyKy
Copy link

KeyKy commented Nov 5, 2018

quantize_level 256 只能降低模型大小,不能提升运行速度。为什么呢,我看到你实现了卷积的int8 这个会和float速度一样吗?

@liuzhuni
Copy link

liuzhuni commented Dec 5, 2018

压缩前模型120M,压缩到float后是60M左右,但是在load_bin文件时,消耗的内存都是一样的,这是怎么回事?不是应该压缩后模型加载时内存要小一半么?

@BUG1989
Copy link
Contributor

BUG1989 commented Mar 15, 2019

armv7a/arm64-v8a均已支持int8加速,请更新代码 :)

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

No branches or pull requests

6 participants