Platform(Include target platform as well if cross-compiling):
macOS
Github版本:
Github Version:
20240912最新版本
直接下载ZIP包请提供下载日期以及压缩包注释里的git版本(可通过7z l zip包路径命令并在输出信息中搜索Comment 获得,形如Comment = bc80b11110cd440aacdabbf59658d630527a7f2b)。 git clone请提供 git commit 第一行的commit id
Provide date (or better yet, git revision from the comment section of the zip. Obtainable using 7z l PATH/TO/ZIP and search for Comment in the output) if downloading source as zip,otherwise provide the first commit id from the output of git commit
请在这里粘贴cmake参数或使用的cmake脚本路径以及完整输出
Paste cmake arguments or path of the build script used here as well as the full log of the cmake proess here or pastebin
编译日志:
Build Log:
默认
2%] Built target MNNCore
[ 2%] Built target MNNCV
[ 2%] Built target MNNMath
[ 14%] Built target MNNTransform
[ 14%] Built target MNNUtils
[ 25%] Built target MNNCPU
[ 25%] Built target MNNX8664
[ 26%] Built target MNNAVX
[ 27%] Built target MNNAVXFMA
[ 28%] Built target MNNSSE
[ 28%] Built target MNN
[ 30%] Built target MNN_Express
[ 34%] Built target MNNTrain
[ 36%] Built target MNNTrainUtils
[ 37%] Built target pictureRecognition.out
[ 37%] Built target pictureRecognition_module.out
[ 37%] Built target multithread_imgrecog.out
[ 37%] Built target pictureRecognition_batch.out
[ 37%] Built target pictureRotate.out
[ 37%] Built target multiPose.out
[ 37%] Built target segment.out
[ 37%] Building CXX object CMakeFiles/yolov8s-seg.out.dir/demo/exec/yolov8s-seg.cpp.o
[ 38%] Linking CXX executable yolov8s-seg.out
[ 38%] Built target yolov8s-seg.out
[ 38%] Built target expressDemo.out
[ 38%] Built target expressMakeModel.out
[ 38%] Built target transformerDemo.out
[ 38%] Built target nluDemo.out
[ 38%] Built target GetMNNInfo
[ 38%] Built target ModuleBasic.out
[ 38%] Built target SequenceModuleTest.out
[ 38%] Built target mergeInplaceForCPU
[ 39%] Built target modelCompare.out
[ 40%] Built target MNNV2Basic.out
[ 40%] Built target mobilenetTest.out
[ 40%] Built target backendTest.out
[ 41%] Built target testModel.out
[ 41%] Built target testModel_expr.out
[ 41%] Built target testModelWithDescribe.out
[ 42%] Built target getPerformance.out
[ 43%] Built target checkInvalidValue.out
[ 44%] Built target timeProfile.out
[ 44%] Built target testTrain.out
[ 44%] Built target fuseTest
[ 44%] Built target LoRA
[ 44%] Built target checkDir.out
[ 44%] Built target checkFile.out
[ 44%] Built target winogradExample.out
[ 44%] Built target benchmark.out
[ 45%] Built target benchmarkExprModels.out
[ 46%] Built target quantized.out
[ 49%] Built target libprotobuf-lite
[ 58%] Built target libprotobuf
[ 58%] Built target transformer
[ 58%] Built target extractForInfer
[ 59%] Built target runTrainDemo.out
[ 59%] Built target MNNCompress
[ 67%] Built target MNNConverterTF
[ 72%] Built target MNNConverterONNX
[ 72%] Built target OnnxClip
[ 76%] Built target MNNConverterCaffe
[ 76%] Built target MNNConverterMNN
[ 92%] Built target MNNConverterOpt
[ 96%] Built target MNNConverterTFL
[ 97%] Built target MNNConvertDeps
[ 98%] Built target MNNConvert
[ 98%] Built target MNNRevert2Buffer
[ 98%] Built target MNNDump2Json
[ 99%] Built target TestConvertResult
[ 99%] Built target TestPassManager
[100%] Built target MNNOpenCV
其实input就是 640x640的bgr的输入。 我的模型的input是 1,3,640,640, data应该是int的。 output是1,42,8400,应该是float。 您看是我input不对吗? pretreat->convert((uint8_t*)inputImage, width, height, 0, input); 还是output不对? 我直接output_t->host() 直接处理输出的tensor?
int main(int argc, const char* argv[]) { if (argc < 4) { MNN_PRINT("Usage: ./segment.out model.mnn input.jpg output.jpg\n"); return 0; } std::shared_ptr net;
net.reset(Interpreter::createFromFile(argv[1]));
if (net == nullptr) {
MNN_ERROR("Invalid Model\n");
return 0;
}
ScheduleConfig config;
auto session = net->createSession(config);
auto input = net->getSessionInput(session, "images");
MNN_PRINT("origin size: line %d\n", LINE);
// input->print();
MNN_PRINT("origin size: line %d\n", LINE);
input->printShape();
MNN_PRINT("origin size: line %d\n", LINE);
}
平台(如果交叉编译请再附上交叉编译目标平台):
Platform(Include target platform as well if cross-compiling):
macOS
Github版本:
Github Version:
20240912最新版本
直接下载ZIP包请提供下载日期以及压缩包注释里的git版本(可通过
7z l zip包路径
命令并在输出信息中搜索Comment
获得,形如Comment = bc80b11110cd440aacdabbf59658d630527a7f2b
)。 git clone请提供git commit
第一行的commit idProvide date (or better yet, git revision from the comment section of the zip. Obtainable using
7z l PATH/TO/ZIP
and search forComment
in the output) if downloading source as zip,otherwise provide the first commit id from the output ofgit commit
编译方式:
Compiling Method
cmake -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=ON -DMNN_BUILD_TOOL=ON -DMNN_BUILD_BENCHMARK=ON -DMNN_BUILD_QUANTOOLS=ON -DMNN_BUILD_OPENCV=ON -DMNN_IMGCODECS=ON ..
编译日志:
Build Log:
默认 2%] Built target MNNCore [ 2%] Built target MNNCV [ 2%] Built target MNNMath [ 14%] Built target MNNTransform [ 14%] Built target MNNUtils [ 25%] Built target MNNCPU [ 25%] Built target MNNX8664 [ 26%] Built target MNNAVX [ 27%] Built target MNNAVXFMA [ 28%] Built target MNNSSE [ 28%] Built target MNN [ 30%] Built target MNN_Express [ 34%] Built target MNNTrain [ 36%] Built target MNNTrainUtils [ 37%] Built target pictureRecognition.out [ 37%] Built target pictureRecognition_module.out [ 37%] Built target multithread_imgrecog.out [ 37%] Built target pictureRecognition_batch.out [ 37%] Built target pictureRotate.out [ 37%] Built target multiPose.out [ 37%] Built target segment.out [ 37%] Building CXX object CMakeFiles/yolov8s-seg.out.dir/demo/exec/yolov8s-seg.cpp.o [ 38%] Linking CXX executable yolov8s-seg.out [ 38%] Built target yolov8s-seg.out [ 38%] Built target expressDemo.out [ 38%] Built target expressMakeModel.out [ 38%] Built target transformerDemo.out [ 38%] Built target nluDemo.out [ 38%] Built target GetMNNInfo [ 38%] Built target ModuleBasic.out [ 38%] Built target SequenceModuleTest.out [ 38%] Built target mergeInplaceForCPU [ 39%] Built target modelCompare.out [ 40%] Built target MNNV2Basic.out [ 40%] Built target mobilenetTest.out [ 40%] Built target backendTest.out [ 41%] Built target testModel.out [ 41%] Built target testModel_expr.out [ 41%] Built target testModelWithDescribe.out [ 42%] Built target getPerformance.out [ 43%] Built target checkInvalidValue.out [ 44%] Built target timeProfile.out [ 44%] Built target testTrain.out [ 44%] Built target fuseTest [ 44%] Built target LoRA [ 44%] Built target checkDir.out [ 44%] Built target checkFile.out [ 44%] Built target winogradExample.out [ 44%] Built target benchmark.out [ 45%] Built target benchmarkExprModels.out [ 46%] Built target quantized.out [ 49%] Built target libprotobuf-lite [ 58%] Built target libprotobuf [ 58%] Built target transformer [ 58%] Built target extractForInfer [ 59%] Built target runTrainDemo.out [ 59%] Built target MNNCompress [ 67%] Built target MNNConverterTF [ 72%] Built target MNNConverterONNX [ 72%] Built target OnnxClip [ 76%] Built target MNNConverterCaffe [ 76%] Built target MNNConverterMNN [ 92%] Built target MNNConverterOpt [ 96%] Built target MNNConverterTFL [ 97%] Built target MNNConvertDeps [ 98%] Built target MNNConvert [ 98%] Built target MNNRevert2Buffer [ 98%] Built target MNNDump2Json [ 99%] Built target TestConvertResult [ 99%] Built target TestPassManager [100%] Built target MNNOpenCV