Closed MrZ13 closed 8 months ago
模型转换的时候加上参数--keepInputFormat
试一下
直接将数据写到input中可能会有格式问题,正常来说需要写到一个tmpInput Tensor中,然后使用input->copyFromHost(tmpInput); 才可以保证没有格式问题
直接将数据写到input中可能会有格式问题,正常来说需要写到一个tmpInput Tensor中,然后使用input->copyFromHost(tmpInput); 才可以保证没有格式问题
感谢回复,请问写入temp tensor的时候是否就需要按照nchw的排布方式调整数据?
Marking as stale. No activity in 60 days.
平台(如果交叉编译请再附上交叉编译目标平台):
Linux admin-NUC8 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Github版本:
v2.5.0 https://github.com/alibaba/MNN/releases/tag/2.5.0
编译方式:
cmake -D CMAKE_BUILD_TYPE=Release \ -D MNN_OPENMP=ON \ -D MNN_USE_THREAD_POOL=OFF \ -D MNN_BUILD_QUANTOOLS=ON \ -D MNN_BUILD_CONVERTER=ON \ -D MNN_BUILD_DEMO=ON \ -D MNN_BUILD_BENCHMARK=ON ..
目标:
在Linux系统的NUC8上部署pytorch训练的模型
问题描述:
以下是完整的推理代码:
include
include
include
include
define STB_IMAGE_IMPLEMENTATION
define STB_IMAGE_WRITE_IMPLEMENTATION
include "stb_image.h"
include "stb_image_write.h"
include <MNN/expr/ExprCreator.hpp>
include "../tools/cv/include/cv/cv.hpp"
include <MNN/ImageProcess.hpp>
include <MNN/Interpreter.hpp>
define MNN_OPEN_TIME_TRACE
include <MNN/AutoTime.hpp>
using namespace MNN; using namespace MNN::CV;
int main(int argc, char* argv[]) { if (argc < 3) { std::cout << "Usage: ./derDetection.out derDetection.mnn input.jpg" << std::endl; }
}