Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.11k stars 4.14k forks source link

使用darknet2ncnn 转化yolov3-tiny模型后,在安卓平台上进行调用,真机测试可以运行,但是没有输出结果 #1800

Open skybocai opened 4 years ago

skybocai commented 4 years ago

05-31 17:55:07.641 22165-22165/? D/yolov3TinyJni: enter the jni func 05-31 17:55:07.663 22165-22165/? D/yolov3: ###############ret_param -1 ret_bin -1 05-31 17:55:07.663 22165-22165/? D/yolov3TinyJni: ncnn_net 05-31 17:55:07.663 22165-22165/? D/load model: MobileNetv2YOLOV3_load_model_result:true 选择图像进行预测后 05-31 17:55:07.733 22165-22188/? W/AdrenoUtils: : Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model

: Failed to read chip ID from gpu_model. Fallback to use the GSL path 05-31 17:55:07.750 22165-22188/? W/Gralloc3: mapper 3.x is not supported 05-31 17:55:15.128 22165-22185/com.example.babi.myapplication I/i.myapplicatio: ProcessProfilingInfo new_methods=10 is saved saved_to_disk=1 resolve_classes_delay=8000 05-31 17:55:41.125 22165-22165/com.example.babi.myapplication D/MobilenetssdJniIn: Mobilenetssd_predict_has_input1, in.w: 416; in.h: 416 05-31 17:55:41.128 22165-22165/com.example.babi.myapplication D/com.example.babi.myapplication.MainActivity: origin predict result:[] 05-31 17:55:41.128 22165-22165/com.example.babi.myapplication D/result length: length of result: 0 05-31 17:55:41.136 22165-22165/com.example.babi.myapplication D/zhuanhuan: [[F@1afd36e 输出结果数组为空
skybocai commented 4 years ago

06-01 09:37:10.765 26183-26183/? I/i.myapplicatio: Late-enabling -Xcheck:jni 06-01 09:37:10.789 26183-26183/? E/i.myapplicatio: Unknown bits set in runtime_flags: 0x8000 06-01 09:37:10.991 26183-26183/? I/i.myapplicatio: The ClassLoaderContext is a special shared library. 06-01 09:37:11.057 26183-26183/? W/i.myapplicatio: JIT profile information will not be recorded: profile file does not exits. 06-01 09:37:11.059 26183-26183/? I/chatty: uid=10070(com.example.babi.myapplication) identical 10 lines 06-01 09:37:11.059 26183-26183/? W/i.myapplicatio: JIT profile information will not be recorded: profile file does not exits. 06-01 09:37:11.066 26183-26183/? I/Perf: Connecting to perf service. 06-01 09:37:11.076 26183-26183/? I/InstantRun: starting instant run server: is main process 06-01 09:37:11.081 26183-26183/? I/FeatureParser: can't find platina.xml in assets/device_features/,it may be in /system/etc/device_features 06-01 09:37:11.096 26183-26183/? E/libc: Access denied finding property "ro.vendor.df.effect.conflict" 06-01 09:37:11.086 26183-26183/? W/i.myapplication: type=1400 audit(0.0:269615): avc: denied { read } for name="u:object_r:vendor_displayfeature_prop:s0" dev="tmpfs" ino=16822 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_displayfeature_prop:s0 tclass=file permissive=0 06-01 09:37:11.102 26183-26207/? E/Perf: Fail to get file list com.example.babi.myapplication getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array Fail to get file list com.example.babi.myapplication 06-01 09:37:11.103 26183-26207/? E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array Fail to get file list oat 06-01 09:37:11.104 26183-26207/? E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array 06-01 09:37:11.136 26183-26183/? E/YOLOV3: initMobileNetSSD YOLOV3 06-01 09:37:11.184 26183-26211/? I/i.myapplicatio: The ClassLoaderContext is a special shared library. 06-01 09:37:11.176 26183-26183/? W/Binder:intercep: type=1400 audit(0.0:269616): avc: denied { getattr } for path="/data/data/com.miui.contentcatcher" dev="dm-2" ino=2490552 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:system_app_data_file:s0 tclass=dir permissive=0 06-01 09:37:11.196 26183-26183/? W/Binder:intercep: type=1400 audit(0.0:269618): avc: denied { getattr } for path="/data/data/com.miui.contentcatcher" dev="dm-2" ino=2490552 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:system_app_data_file:s0 tclass=dir permissive=0 06-01 09:37:11.207 26183-26211/? W/i.myapplicatio: Accessing hidden method Lmiui/contentcatcher/sdk/Token;->(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V (greylist, linking, allowed) 06-01 09:37:11.208 26183-26211/? W/i.myapplicatio: Accessing hidden method Lmiui/contentcatcher/InterceptorProxy;->getWorkThread()Landroid/os/HandlerThread; (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/ContentCatcherManager;->getInstance()Lmiui/contentcatcher/sdk/ContentCatcherManager; (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/ContentCatcherManager;->getPageConfig(Lmiui/contentcatcher/sdk/Token;)Lmiui/contentcatcher/sdk/data/PageConfig; (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/data/PageConfig;->getFeatures()Ljava/util/ArrayList; (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/data/PageConfig;->getCatchers()Ljava/util/ArrayList; (greylist, linking, allowed) 06-01 09:37:11.209 26183-26211/? W/i.myapplicatio: Accessing hidden method Lcom/miui/internal/viewcontentfetcher/IViewContentFetcher;->fetchViewContent(Landroid/view/View;I)Landroid/os/Bundle; (greylist, linking, allowed) Accessing hidden field Lmiui/contentcatcher/sdk/data/CatcherInfo;->name:Ljava/lang/String; (greylist, linking, allowed) Accessing hidden method Lcom/miui/internal/viewcontentfetcher/IViewContentFetcher;->fetchWebViewBitmap(Landroid/view/View;I)Landroid/os/Bundle; (greylist, linking, allowed) 06-01 09:37:11.210 26183-26211/? W/i.myapplicatio: Accessing hidden field Lmiui/contentcatcher/sdk/data/FeatureInfo;->name:Ljava/lang/String; (greylist, linking, allowed) Accessing hidden field Lmiui/contentcatcher/sdk/data/FeatureInfo;->enable:Z (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/data/FeatureInfo;->getCatcherNameList()Ljava/util/List; (greylist, linking, allowed) Accessing hidden field Lmiui/contentcatcher/sdk/data/FeatureInfo;->mParams:Ljava/util/HashMap; (greylist, linking, allowed) Accessing hidden method Lcom/miui/internal/viewcontentfetcher/IViewContentFetcher;->createFetcher(Lmiui/contentcatcher/sdk/Token;Ljava/util/Map;)V (greylist, linking, allowed) 06-01 09:37:11.211 26183-26211/? W/i.myapplicatio: Accessing hidden field Lmiui/contentcatcher/sdk/Content;->TARGET:Ljava/lang/String; (greylist, linking, allowed) Accessing hidden field Lmiui/contentcatcher/sdk/Content;->JOB:Ljava/lang/String; (greylist, linking, allowed) Accessing hidden field Lmiui/contentcatcher/sdk/Content;->TOKEN_KEY:Ljava/lang/String; (greylist, linking, allowed) 06-01 09:37:11.212 26183-26211/? W/i.myapplicatio: Accessing hidden method Lmiui/contentcatcher/sdk/ContentCatcherManager;->registerContentInjector(Lmiui/contentcatcher/sdk/Token;Lmiui/contentcatcher/sdk/injector/IContentDecorateCallback;)V (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/ContentCatcherManager;->unregisterContentInjector(Lmiui/contentcatcher/sdk/Token;)V (greylist, linking, allowed) 06-01 09:37:11.213 26183-26211/? W/i.myapplicatio: Accessing hidden method Lmiui/contentcatcher/sdk/Content;->(ILjava/lang/String;Lmiui/contentcatcher/sdk/Token;Ljava/util/Map;)V (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/ContentCatcherManager;->onContentCatched(Lmiui/contentcatcher/sdk/Content;)V (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/Content;->(Landroid/content/Intent;Landroid/os/Bundle;)V (greylist, linking, allowed) 06-01 09:37:11.215 26183-26211/? W/i.myapplicatio: Accessing hidden method Lmiui/contentcatcher/sdk/Token;->getActivityName()Ljava/lang/String; (greylist, linking, allowed) 06-01 09:37:11.216 26183-26211/? W/i.myapplicatio: Accessing hidden method Landroid/app/AppGlobals;->getInitialApplication()Landroid/app/Application; (greylist, linking, allowed) 06-01 09:37:11.216 26183-26211/? D/ViewContentFactory: initViewContentFetcherClass getInterceptorPackageInfo 06-01 09:37:11.217 26183-26211/? D/ViewContentFactory: getInitialApplication took 1ms packageInfo.packageName: com.miui.catcherpatch 06-01 09:37:11.227 26183-26211/? W/i.myapplicatio: Accessing hidden method Lmiui/util/ObjectReference;->get()Ljava/lang/Object; (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/Token;->getPkgName()Ljava/lang/String; (greylist, linking, allowed) Accessing hidden method Lmiui/contentcatcher/sdk/Token;->getVersionCode()I (greylist, linking, allowed) 06-01 09:37:11.227 26183-26211/? D/ViewContentFactory: initViewContentFetcherClass took 11ms 06-01 09:37:11.228 26183-26211/? I/ContentCatcher: ViewContentFetcher : ViewContentFetcher 06-01 09:37:11.228 26183-26211/? D/ViewContentFactory: createInterceptor took 11ms 06-01 09:37:11.263 26183-26183/? W/i.myapplicatio: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) 06-01 09:37:11.265 26183-26183/? W/i.myapplicatio: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) 06-01 09:37:11.300 26183-26183/? E/MainActivity: initMobileNetSSD s 06-01 09:37:11.300 26183-26183/? E/initMobileNetV2YOLOV3: initMobileNetV2YOLOV3 67 06-01 09:37:11.301 26183-26183/? E/initMobileNetV2YOLOV3: initMobileNetV2YOLOV3 71 initMobileNetV2YOLOV3 76 initMobileNetV2YOLOV3 81 06-01 09:37:11.579 26183-26183/? E/initMobileNetV2YOLOV3: initMobileNetV2YOLOV3 86 06-01 09:37:11.579 26183-26183/? D/yolov3TinyJni: enter the jni func 06-01 09:37:11.579 26183-26183/? D/NcnnJni: load_param -1 4429 06-01 09:37:11.604 26183-26183/? D/NcnnJni: load_model -1 34705028 06-01 09:37:11.604 26183-26183/? D/yolov3TinyJni: ncnn_net 06-01 09:37:11.604 26183-26183/? D/load model: MobileNetv2YOLOV3_load_model_result:true 06-01 09:37:11.604 26183-26183/? E/MainActivity: initMobileNetSSD ok 06-01 09:37:11.639 26183-26183/? W/Looper: Slow Looper main: Activity com.example.babi.myapplication/.MainActivity is 652ms late (wall=0ms running=0ms ClientTransaction{ callbacks=[android.app.servertransaction.TopResumedActivityChangeItem] }) because of 2 msg, msg 1 took 270ms (seq=2 late=2ms h=android.app.ActivityThread$H w=110), msg 2 took 540ms (seq=3 late=112ms h=android.app.ActivityThread$H w=159) 06-01 09:37:11.679 26183-26208/? I/AdrenoGLES: QUALCOMM build : f2ab992, I401605978b Build Date : 09/28/19 OpenGL ES Shader Compiler Version: EV031.27.05.01 Local Branch : Remote Branch : Remote Branch : Reconstruct Branch : Build Config : S L 8.0.11 AArch32 06-01 09:37:11.683 26183-26208/? I/AdrenoGLES: PFP: 0x005ff112, ME: 0x005ff066 06-01 09:37:11.685 26183-26208/? W/AdrenoUtils: : Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model

: Failed to read chip ID from gpu_model. Fallback to use the GSL path 06-01 09:37:11.713 26183-26208/? W/Gralloc3: mapper 3.x is not supported 06-01 09:37:19.064 26183-26205/com.example.babi.myapplication I/i.myapplicatio: ProcessProfilingInfo new_methods=10 is saved saved_to_disk=1 resolve_classes_delay=8000 06-01 09:37:28.655 26183-26183/com.example.babi.myapplication D/yolov3TinyJni: -978864796 06-01 09:37:28.656 26183-26183/com.example.babi.myapplication D/com.example.babi.myapplication.MainActivity: origin predict result:[] 06-01 09:37:28.656 26183-26183/com.example.babi.myapplication D/result length: length of result: 0 06-01 09:37:28.669 26183-26183/com.example.babi.myapplication D/zhuanhuan: [[F@e25cf04
lhxy1991 commented 4 years ago

我也遇到了同样的问题,你解决了吗?看你的log ,跟我的一样,模型加载的时候失败了

skybocai commented 4 years ago

没有,我现在使用darknet2ncnn中的一个文件进行了验证,发现param.bin 和 bin 文件进行测试,显示layer -1 的报错,使用param 和bin 能够成功,我正在将成功的代码迁移到安卓中看能不能成功出现结果

2017ZYS commented 4 years ago

05-31 17:55:07.641 22165-22165/? D/yolov3TinyJni: enter the jni func 05-31 17:55:07.663 22165-22165/? D/yolov3: ###############ret_param -1 ret_bin -1 05-31 17:55:07.663 22165-22165/? D/yolov3TinyJni: ncnn_net 05-31 17:55:07.663 22165-22165/? D/load model: MobileNetv2YOLOV3_load_model_result:true 选择图像进行预测后 05-31 17:55:07.733 22165-22188/? W/AdrenoUtils: : Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model ReadGpuID:218: Failed to read chip ID from gpu_model. Fallback to use the GSL path 05-31 17:55:07.750 22165-22188/? W/Gralloc3: mapper 3.x is not supported 05-31 17:55:15.128 22165-22185/com.example.babi.myapplication I/i.myapplicatio: ProcessProfilingInfo new_methods=10 is saved saved_to_disk=1 resolve_classes_delay=8000 05-31 17:55:41.125 22165-22165/com.example.babi.myapplication D/MobilenetssdJniIn: Mobilenetssd_predict_has_input1, in.w: 416; in.h: 416 05-31 17:55:41.128 22165-22165/com.example.babi.myapplication D/com.example.babi.myapplication.MainActivity: origin predict result:[] 05-31 17:55:41.128 22165-22165/com.example.babi.myapplication D/result length: length of result: 0 05-31 17:55:41.136 22165-22165/com.example.babi.myapplication D/zhuanhuan: [[F@1afd36e 输出结果数组为空 试着把置信度调低一点试一下,我之前训练的tiny-yolov3转成ncnn,置信度设置为0.01才有结果,貌似置信度有衰减十倍的迹象

nihui commented 4 years ago

是不是api用错了,看看这里 https://github.com/Tencent/ncnn/wiki/ncnn-load-model