Used Tencent ncnn, compile them very friendly; but 3d operation operator support is not enough; cause the model to emerging unusable.
See mnn Ali developed to taste fresh, the result of intermittent toss two days, in order to remember it.
thank you very much:
https://uzshare.com/view/810473
https://www.yuque.com/mnn/cn/build_windows
Which details a number of configurations.
1. Set
2, the powershell ./schema/generate.ps1 into python ./schema/generate.py
If you want to compile x64, will
os.system('cmake -DCMAKE_BUILD_TYPE=Release ..')
changed to
os.system('cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release ..')
This step can also go directly to the
https://github.com/google/flatbuffers/releases
下flatc.exe, 在..\MNN-master\3rd_party\flatbuffers\tmp\flatc.exe
3、cmake x64 only mnn.lib/mnn.dll
mkdir vs15x64 && cd vs15x64 cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release .. cd.. cmake --build vs15x64 --config Release
There will be normal
error C2280: 'std::unique_ptr<MNN::Pipeline,std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)': attempting to reference a deleted function
Solution: https://github.com/Hconk/MNN/commit/819a666135a420f680675d503fabfa14028e13d2
//Session.hpp
private:
std::map<MNNForwardType, std::unique_ptr<Backend>> mBackends;
std::vector<std::unique_ptr<Pipeline>> mPipelines;
std::vector<std::pair<int, std::shared_ptr<Tensor>>> mTensors;
std::map<std::string, Tensor*> mInputs;
std::map<std::string, Tensor*> mOutputs;
bool mNeedResize = false;
bool mValid = true;
Backend* mFirstBackend = nullptr;
Session(const Session&) = delete;
Session(const Session&&) = delete;
Session& operator=(const Session&) = delete;
Session& operator=(const Session&&) = delete;
So basically you can get MNN.lib with the MNN.dll.
4, this compiling Conver Tool [toss me the longest, as if burst foul language]
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release -DMNN_BUILD_CONVERTER=ON ..
Q1, configuration protobuf
Under Win7, add the path environment variable protoc.exe located, and then run under cmd protoc.exe
Q2, tflite error
error lnk2019: error flatbuffers::ClassicLocale flatbuffers::ClassicLocale::instance_" (?instance_@ClassicLocale@flatbuffers@@0V12@A)
Solution: Add MNN-master \ 3rd_party \ flatbuffers \ src \ util.cpp to tflite project
So basically you can compiled a