Closed zhra46 closed 4 years ago
Maybe caused by the following issues: 1、For gpu backends (include VULKAN、OPENGL and OPENCL), there maybe a little precision loss. 2、Vulkan and opengl backends are not fully tested, and there maybe some bugs. We will release the newest version this month and please try it again.
Maybe caused by the following issues: 1、For gpu backends (include VULKAN、OPENGL and OPENCL), there maybe a little precision loss. 2、Vulkan and opengl backends are not fully tested, and there maybe some bugs. We will release the newest version this month and please try it again.
1123
thank you for your reply. but i don't think this is a precision problem, in center-face case, gpu backends inference cannot even get a confidence score > 0.1 (with cpu backends, there are multiple predictions conf score is 0.88,same picture same code) looking forward to new version
with cpu backends, there are multiple predictions conf score is 0.88,same picture same code) looking forward to new version
I am in the same situation with yolov model, VULKAN and OPENCL take as much time as cpu, OPENGL is extremely faster. All of these do not work except the CPU, and the values of confidences are always zero.
你可以将输入tensor 使用以下方式打印出来看看` auto nhwcTensor = new MNN::Tensor(inputTensor, inputTensor->getDimensionType(),true);
// nhwcTensor-host
LOGI("after convert:%f,%f,%f,%f", nhwcTensor->host<float>()[0],
nhwcTensor->host<float>()[1],
nhwcTensor->host<float>()[2],
nhwcTensor->host<float>()[3]);
delete nhwcTensor;
` 我的情况就是这个tensor 多次循环的情况下 没变过
更新下代码测试一下 Vulkan / OpenCL 吧
谢谢马上看看代码并测试一番
平台(如果交叉编译请再附上交叉编译目标平台):
Platform(Include target platform as well if cross-compiling):
android: rk3399-all gpu: MALI-T860 android版本: 7.1.2 openGL:es3.2 v1 编译MNN so库平台: ubunt 18.04 ndk android-ndk-r18b
Github版本:547a284baafa9443c6d2615980eabec3200e10b5
Github Version:
编译方式: NDK交叉编译
Compiling Method
cmake 脚本:
编译脚本:
编译日志:
Build Log:
问题描述:
center-face项目迁移至andorid端MNN框架进行推理时 VULKAN、OPENGL后端输出结果错误,cpu推理输出结果正确 项目地址:https://github.com/Star-Clouds/CenterFace 其中包含了 MNN的推理代码(路径:https://github.com/Star-Clouds/CenterFace/tree/master/prj-mnn) 以及mnn的模型文件(路径:CenterFace/models/mnn/)
使用自己训练的 4层全连接层模型 输入 1,15 向量 输出 1,1 标量, 推理结果 同样不一致, 模型文件:https://github.com/zhra46/crnn.pytorch/raw/master/dist_mlp.mnn 输入 尺寸 15,1,1,1 输入测试数据: float input[15] = {0.4831, 0.3268, 0.5203, 0.4072, 0.9992, 0.4944, 0.3581, 0.5102, 0.3624,0.5007, 0.3761, 0.4934, 0.3852, 0.5067, 0.3886}; cpu输出:2.7199
OPENGL输出: 1.67 VULKAN输出 : 1.84 (不同设备不一致) 测试代码: