Tencent / TNN

TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and performance optimization for mobile devices, and also draws on the advantages of good extensibility and high performance from existed open source efforts. TNN has been deployed in multiple Apps from Tencent, such as Mobile QQ, Weishi, Pitu, etc. Contributions are welcome to work in collaborative with us and make TNN a better framework.
Other
4.38k stars 766 forks source link

TNN API ERROR:0x1002 #1900

Closed Augenstern-create closed 1 year ago

Augenstern-create commented 1 year ago

1. 环境(environment) Windows 10 opencl

2. Github版本 TNN V0.3.0

3. 编译方式(compile method) .\TNN\examples\windows\opencl\build_msvc.bat

5. 详细描述bug 情况 (Describe the bug) 使用VS2020打开编译好的TNN-demo.sln文件更改项目demo_opencl_imageclassify_opengl生成为dll文件,将TNNImageClassifyOpenGL.cc中的main函数改为int testImageClassify(unsigned char protopath, unsigned char modelpath,unsigned char synset,unsigned char input__img);把FLAGS_p,FLAGS_m,FLAGS_l,FLAGS_i替换为函数参数,新建TNNImageClassifyOpenGL.h文件,暴露int testImageClassify()函数,生成dll后使用c#控制台调用dll,后报错

E/tnn: tnn::TNNSDKSample::Init [File E:\tnn-2023-3-6\TNN\examples\base\tnn_sdk_sample.cc][Line 574] instance.net init failed 4098 E/tnn: tnn::TNNSDKSample::Init [File E:\tnn-2023-3-6\TNN\examples\base\tnn_sdk_sample.cc][Line 574] instance.net init failed 4098 TNN API ERROR:0x1002E/tnn: tnn::TNNSDKSample::Init [File E:\tnn-2023-3-6\TNN\examples\base\tnn_sdk_sample.cc][Line 574] instance.net init failed 4098

printf打印路径,路径正确

不更改为dll直接使用编译好的exe文件推理成功!!!

7. 截图(Screenshots)

推理失败截图
![图片](https://user-images.githubusercontent.com/88466224/223079050-24babff1-ef69-433a-937c-3021e7c9e930.png)

使用绝对路径依旧报错
![图片](https://user-images.githubusercontent.com/88466224/223079583-a686792c-4fe1-4a9e-ba41-1bd0ef8b9933.png)

推理成功截图
![图片](https://user-images.githubusercontent.com/88466224/223079130-65fc9003-6b29-4b37-aeaf-f8b5bd439b96.png)
Augenstern-create commented 1 year ago

推理时模型输入错误,输入的应该是读取模型文件后的字符串,而不是模型的地址