DefTruth / lite.ai.toolkit

🛠 A lite C++ toolkit of awesome AI models, support ONNXRuntime, MNN, TNN, NCNN and TensorRT.
https://github.com/DefTruth/lite.ai.toolkit
GNU General Public License v3.0
3.59k stars 684 forks source link

Android arm64-v8a TNN 环境 BasicTNNHandler::get_input_data_format(instance, "src") 获取的input_data_format 不对 #335

Closed BrainSurgeAI closed 2 years ago

BrainSurgeAI commented 2 years ago

Hi, 当我在Linux下运行测试程序没有问题,但当我交叉编译到 android环境下,发现BasicTNNHandler::get_input_data_format(instance, "src")返回的 input_data_format 是 4( DATA_FORMAT_NC4HW4),而Linux环境下是正常的 0 (DATA_FORMAT_NCHW) 两个环境下用的都是 rvm_mobilenetv3_fp32-640-480-sim.opt.tnnproto rvm_mobilenetv3_fp32-640-480-sim.opt.tnnmodel 请问这是怎么回事?

DefTruth commented 2 years ago

这可能是TNN的问题,你可以查一下如何强制设置成NCHW。模型文件本身肯定是一样的,只是应该是TNN在不同的硬件下的默认处理不一样。最近工作比较忙,暂时没有精力将 lite.ai.toolkit 移植到 Arm 上了 ~

BrainSurgeAI commented 2 years ago

Hi, @DefTruth 我直接将BasicTNNHandler::get_input_data_format(instance, "src") 返回设置成 (DATA_FORMAT_NCHW 就可以了,谢谢