Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still cannot run custom training model in this Project. #23

Open
hoanhvmetavi opened this issue Mar 10, 2023 · 5 comments
Open

Still cannot run custom training model in this Project. #23

hoanhvmetavi opened this issue Mar 10, 2023 · 5 comments

Comments

@hoanhvmetavi
Copy link

I, i have an issue about using my trainning model.

I am following this issue in:
#1 #3 #8

But when running app in android studio, the app crashed. Change back your model in to the app, it worked nomarlly.
My onnx model can run infer normal, so i think that my ncnn model has an issue or the app does not run my model correctly.
I am stuck at this for some days, so please give me a hand.

Many thanks.

@hoanhvmetavi
Copy link
Author

Logs:


03/10 10:18:58: Launching 'app' on Pixel XL API 30.
Install successfully finished in 273 ms.
$ adb shell am start -n "com.tencent.ncnnyolox/com.tencent.ncnnyolox.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 9990 on device 'Pixel_XL_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/ncent.ncnnyolo: Late-enabling -Xcheck:jni
I/ncent.ncnnyolo: Unquickening 12 vdex files!
W/ncent.ncnnyolo: Unexpected CPU variant for X86 using defaults: x86
D/ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
I/ncent.ncnnyolo: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/ncnn: JNI_OnLoad
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
D/ncnn: loadModel 0xe76c29c0
D/ncnn: openCamera 0
W/NdkCamera: open
W/NdkCamera: open 1 270
E/ACameraManager: openCamera: connect camera device failed: Status(-8, EX_SERVICE_SPECIFIC): '1: validateClientPermissionsLocked:1165: Caller "" (PID 10123, UID 9990) cannot open camera "1" without camera permission'
E/NdkCameraDevice: ACameraDevice_createCaptureRequest: invalid argument! device 0x0 request 0xe7d12f90
E/NdkCaptureRequest: ACaptureRequest_addTarget: Error: invalid input: req 0x0, req-targets 0x0, target 0xe7e7a8d0
E/NdkCameraDevice: ACameraDevice_createCaptureSession: Error: invalid input: device 0x0, outputs 0xe7e7a850, callbacks 0xffbd8bb0, session 0xe7d12f9c
E/NdkCameraCaptureSession: ACameraCaptureSession_setRepeatingRequest: Error: invalid input: session 0x0, numRequest 1, requests 0xe7d12f90
D/ncnn: closeCamera
W/NdkCamera: close
D/HostConnection: HostConnection::get() New Host Connection established 0xe7b1bf30, tid 10018
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data ANDROID_EMU_vulkan_async_qsri ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xe7b1c6a0: maj 3 min 0 rcv 3
D/ncnn: setOutputWindow 0xe238c998
D/EGL_emulation: eglMakeCurrent: 0xe7b1c6a0: ver 3 0 (tinfo 0xe7e7b8b0) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xe7b24890, tid 10018
D/goldfish-address-space: allocate: Ask for block of size 0x100
D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3ebffe000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data ANDROID_EMU_vulkan_async_qsri ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
D/ncnn: openCamera 0
W/NdkCamera: open
W/NdkCamera: open 1 270
W/NdkCamera: onSessionActive 0xe7ddfb40
W/Gralloc4: allocator 3.x is not supported
W/ncnn: find_blob_index_by_name input failed
W/ncnn: Try
W/ncnn:     ex.input("images", in0);
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 10021 (ImageReader-640), pid 9990 (ncent.ncnnyolox)

@FeiGeChuanShu
Copy link
Owner

@hoanhvmetavi change the input to the real blob name in your param.
https://github.com/FeiGeChuanShu/ncnn-android-yolox/blob/main/app/src/main/jni/yolox.cpp#L357

@hoanhvmetavi
Copy link
Author

@FeiGeChuanShu Forgive my dumb c++ skill. Thanks very much.

@hoanhvmetavi
Copy link
Author

I was able to add a model to the app.
But when i add another new model that i trained, it does not have Yolov5 Focus layer. So i have to edit the model that following to this: https://github.com/Megvii-BaseDetection/YOLOX/tree/main/demo/ncnn/cpp
But in the step 4:

Then remove 10 lines of code from Split to Concat, but remember the last but 2nd number: 683.

I understand this step but my .param model file, position of the last but 2nd is not a number. Its /backbone/backbone/stem/Concat_output_0

Concat           /backbone/backbone/stem/Concat 4 1 /backbone/backbone/stem/Slice_1_output_0 /backbone/backbone/stem/Slice_4_output_0 /backbone/backbone/stem/Slice_2_output_0 /backbone/backbone/stem/Slice_5_output_0 /backbone/backbone/stem/Concat_output_0 0=0
Convolution      /backbone/backbone/stem/conv/conv/Conv 1 1 /backbone/backbone/stem/Concat_output_0 /backbone/backbone/stem/conv/conv/Conv_output_0 0=16 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1728

So how do i convert this case, or am i missing another guide to handle this model?
Thanks.

@hoanhvmetavi
Copy link
Author

For convenience, i will share my onnx model to you: https://1drv.ms/u/s!AoXQI1SRzY-tglL0qKI59iQcbibe?e=5mcq6I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants