天天看点

MNNConverter编译错误: recipe for target ‘tools/converter/CMakeFiles/MNNConverterONNX.dir/all‘ failed

终端错误输出如下

tools/converter/CMakeFiles/MNNConverterONNX.dir/build.make:78: recipe for target 'tools/converter/CMakeFiles/MNNConverterONNX.dir/source/onnx/ArgMaxOnnx.cpp.o' failed
make[2]: *** [tools/converter/CMakeFiles/MNNConverterONNX.dir/source/onnx/ArgMaxOnnx.cpp.o] Error 1
CMakeFiles/Makefile2:1218: recipe for target 'tools/converter/CMakeFiles/MNNConverterONNX.dir/all' failed
make[1]: *** [tools/converter/CMakeFiles/MNNConverterONNX.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
           

解决:

1.换台没装过protobuf(/usr/bin/里没有protoc文件,说明该服务器无默认已装protobuf,也可以使用

protoc --version

which protoc

命令看protobuf是否安装,一般默认安装的protobuf版本很老(2.6.1))的服务器根据https://github.com/protocolbuffers/protobuf/blob/master/src/README.md

编译protobuf就完事了;

2.先

sudo apt-get autoremove libprotobuf-dev protobuf-compiler

,编译protobuf的时候使用

./configure --prefix=/usr

,在configure后加个prefix使得最新版的protobuf装在linux默认目录中,可能会替代default installed protobuf(2.6.1)

———————————————— 更新 —————————————————

protobuf要卸载干净包括当前虚拟环境的protobuf(conda uninstall pip uninstall都来几遍)加上上述操作2

mnn