Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
5 years ago | |
---|---|---|
.. | ||
Makefile | 5 years ago | |
README.md | 4 years ago | |
dump_model.py | 5 years ago | |
extern_c_opr.h | 5 years ago | |
mace_loader.cpp | 4 years ago |
load_and_run
for arm64-v8acd $MEGENGINE_HOME
./scripts/cmake-build/cross_build_android_arm_inference.sh -a arm64-v8a
After successfully built, load_and_run should be in $MEGENGINE_HOME/build_dir/android/arm64-v8a/Release/install/bin
cd $MACE_HOME
RUNTIME=GPU bash tools/cmake/cmake-build-arm64-v8a.sh
cp -r $MACE_HOME/build/cmake-build/arm64-v8a/install $MEGENGINE_HOME/sdk/c-opr-loaders/mace/arm64-v8a
SDK_PATH=/path/to/mace-sdk make
If SDK_PATH
is not set, by default it's ./arm64-v8a
You can run with debug mode(by adding DEBUG=1
to make command), which will show more running information
python3 dump_model.py path/to/resnet_50.pb path/to/resnet_50.data path/to/resnet_50.mdl path/to/resnet_50.yml
*.pb
file denotes the model structure, *.data
denotes the model parameters
Check here to learn how to write yml files for MACE
First of all, send all files to the executed device:
MGB_MACE_RUNTIME=GPU MGB_MACE_OPENCL_PATH=/path/to/opencl MGB_MACE_LOADER_FORMAT=NCHW /path/to/load_and_run /path/to/resnet_50.mdl --c-opr-lib /path/to/libmace_loader.so
RUNTIME candidates:
Running with GPU runtime on android needs opencl library, one can set MGB_MACE_OPENCL_PATH
by using environment variable
We mainly use NCHW data format, if you have NHWC model, use environment MGB_MACE_LOADER_FORMAT=NHWC
For CPU runtime, default running thread is 1, could be specified with MGB_MACE_NR_THREADS=n
if you want to run with HEXAGON runtime, more efforts should be made, please check here.
MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台
C++ Cuda Python C SVG other