https://github.com/alibaba/MNN
MNN官方常见问题解决方法https://www.yuque.com/mnn/en/faq

python

版本问题
pip install MNN==1.1.3
File “/media/wwf/data/ubuntuSoft/anaconda/lib/python3.7/site-packages/MNN/init.py”, line 8, in
from _mnncengine import *
Exception: initMNN: init numpy failed

原先numpy 1.19*

解决方法

numpy==1.20.1
尝试版本MNN ,python MNN 安装成功

MNN numpy
1.1.1 1.18.5
1.1.2 1.19.5
1.20.1 1.20.1

ubuntu

  1. clang version 10.0.0-4ubuntu1
  2. Target: x86_64-pc-linux-gnu
  3. Thread model: posix
  4. InstalledDir: /usr/bin
  5. g++ (Ubuntu 7.5.0-6ubuntu2) 7.5.0 ->4.9
  6. Copyright (C) 2017 Free Software Foundation, Inc.
  7. This is free software; see the source for copying conditions. There is NO
  8. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0 ->4.9
  10. Copyright (C) 2017 Free Software Foundation, Inc.
  11. This is free software; see the source for copying conditions. There is NO
  12. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcc 4.9

g++ 4.9

1 .编辑器

gcc/g++/clang

apt-get install llvm

apt-get install clang

2 error

error MNN::Express::Expr::create(MNN::Tensor, bool)’
/usr/bin/ld: CMakeFiles/run.dir/segment.cpp.o: in function main': segment.cpp:(.text+0x1fe63): undefined reference toMNN::Express::Expr::create(MNN::Tensor
, bool)’ /usr/bin/ld: segment.cpp:(.text+0x1fe81): undefined reference to MNN::Express::Variable::create(std::shared_ptr, int)’ /usr/bin/ld: segment.cpp:(.text+0x1fea7): undefined reference to MNN::Express::Variable::getInfo()' /usr/bin/ld: segment.cpp:(.text+0x1ff01): undefined reference toMNN::Express::_Convert(MNN::Express::VARP, MNN::Express::Dimensionformat)’ collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/run.dir/build.make:113:run] 错误 1 make[1]: [CMakeFiles/Makefile2:83:CMakeFiles/run.dir/all] 错误 2 make: * [Makefile:91:all] 错误 2

没有链接 libMNN_Express.so ,在编译 MNN 时关闭分离编译也可以 -DMNN_SEP_BUILD=false(这样 Express 部分与. MNN 合一)

2.1 android gcc/clang

gcc/g++ error

GCC is no longer supported.

CMake Error at /media/wwf/data/ubuntuSoft/android/ndk/21.3.6528147/build/cmake/android.toolchain.cmake:166 (message):
  GCC is no longer supported.  See
  https://android.googlesource.com/platform/ndk/+/master/docs/ClangMigration.md.
Call Stack (most recent call first):
  /media/wwf/data/ubuntuSoft/anaconda/envs/th/lib/python3.7/site-packages/cmake/data/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:30 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
make: *** 没有指明目标并且找不到 makefile。 停止。

g++/gcc 版本选择

使用clang替换gcc/g++

由于 Android OS 放弃GCC转向了 Clang 编译器, 所以 NDK 将移除GCC, 所以建议用Clang编译你的程序。

修改 Applicaiton.mk 中的相关配置

1. APP_STL  := gnustl_static 改为 APP_STL := c++_static;

2.删除NDK_TOOLCHAIN or NDK_TOOLCHAIN_VERSION;



对于cmake编译:

1.删除 ANDROID_TOOLCHAIN

对于独立的toolchains

用clang/clang++ binaries 代替 gcc/g++.

使用gcc/g++ 4.9 版本

Android NDK: WARNING: Deprecated NDK_TOOLCHAIN_VERSION value: 4.9. GCC is no longer supported 

NDK 版本过新,会出现如上错误,因为Android NDK从r11开始建议大家切换到clang。并且把GCC标记为deprecated,将GCC版本锁定在GCC 4.9不再更新。
谷歌迁移提醒

https://zhuanlan.zhihu.com/p/27470060

2.2ubuntu cuda

-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found suitable version "10.2", minimum required is "9.0")
CMake Error at source/backend/cuda/CMakeLists.txt:13 (message):
  CUDA not found >= 9.0 required)

2.3 DCMAKE_SYSTEM_PROCESSOR


fatal error: arm_neon.h: 没有那个文件或目录
#-DCMAKE_SYSTEM_PROCESSOR=arm64 \



# arm64  aarch64