Upcoming maintenance
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.
error while Inputting image in tensorflow input to do classification with tflite micro
-
Hello,
I'm currently using a tflite micro model on arduino to make animals classification with image of size 2242243.
After taking photo, i converted it to rgb to have usable pixels. I am trying to put these pixels in the input tensor of the interpreter.
The input tensor is pretty large (150k) and when i reach the ~ 120kth, i'm facing this error :
1296arm_hardfault: PANIC!!! Hard fault: 40000000 up_assert: Assertion failed at file:armv7-m/arm_hardfault.c line: 135 task: init up_registerdump: R0: 0030302e 0d11159c 0d10998b 00000000 0030302e 0030302e 0d101c14 0d08335c up_registerdump: R8: 00000000 00000000 00000000 00000000 00000000 0d111588 0d00db7d 0d00db48 up_registerdump: xPSR: 61000000 BASEPRI: 000000e0 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_dumpstate: sp: 0d1026b8 up_dumpstate: IRQ stack: up_dumpstate: base: 0d101f18 up_dumpstate: size: 00000800 up_dumpstate: used: 00000198 up_stackdump: 0d1026a0: 00000000 0d1026b8 0d10456c 00001ff0 0d101f18 0d02178b 00000087 0d10f298 up_stackdump: 0d1026c0: 00000080 0d10456c 0d1114b4 00000003 00000000 00000000 00000000 00000000 up_stackdump: 0d1026e0: 00000000 0d01105b 0d0137cb 0d010c0f 0d010bed 0d01c23b 000000e0 0d010be1 up_stackdump: 0d102700: 000000e0 0d1114b4 0030302e 0d101c14 0d08335c 0d00fe2f 00000000 00000000 up_dumpstate: sp: 0d111588 up_dumpstate: User stack: up_dumpstate: base: 0d10f608 up_dumpstate: size: 00001ff0 up_dumpstate: used: 00000be4 up_stackdump: 0d111580: 80000010 30303030 00000000 0030302e 0001fad2 0d000445 0d109920 0d109960 up_stackdump: 0d1115a0: 0000002b 0000002b 54434950 2e303030 0047504a 00000000 0d08336c 0d08336c up_stackdump: 0d1115c0: 0d000000 0d00dd61 00000000 0d103d08 0d00dd21 00000000 00000000 0d0228bd up_stackdump: 0d1115e0: 0d00dd21 00000001 00000000 0d01dc29 00000000 00000000 00000090 80002020 up_taskdump: Idle Task: PID=0 Stack Used=460 of 1000 up_registerdump: R0: 00000000 0d103714 0d108f44 00000000 00000000 0d103690 0d1045be 00000000 up_registerdump: R8: 0d1037e8 81c9ecc5 51c57e76 826404e9 00000000 0d105040 0d01c107 0d01fd5a up_registerdump: xPSR: 41000000 BASEPRI: 000000e0 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: hpwork: PID=1 Stack Used=604 of 2016 up_registerdump: R0: 00000002 0d105bc4 0d103714 0d105bc4 0d105b40 00000080 0d1045d4 00000000 up_registerdump: R8: 0d1045dc 00000000 00000000 00000000 01ff0000 0d1067c0 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: lpwork: PID=2 Stack Used=268 of 2016 up_registerdump: R0: 00000002 0d106894 0d107564 0d106894 0d106810 00000080 0d1045e0 00000000 up_registerdump: R8: 0d1045e8 00000000 00000000 00000000 00000000 0d107490 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: lpwork: PID=3 Stack Used=268 of 2016 up_registerdump: R0: 00000002 0d107564 0d108234 0d107564 0d1074e0 00000080 0d1045e0 00000000 up_registerdump: R8: 0d1045e8 00000000 00000000 00000000 00000000 0d108160 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: lpwork: PID=4 Stack Used=268 of 2016 up_registerdump: R0: 00000002 0d108234 0d103714 0d108234 0d1081b0 00000080 0d1045e0 00000000 up_registerdump: R8: 0d1045e8 00000000 00000000 00000000 00000000 0d108e30 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: cxd56_pm_task: PID=6 Stack Used=400 of 1000 up_registerdump: R0: 00000002 0d109f94 0d103714 0d109f94 0d10a9f0 0d10a74c 0d109f10 00000000 up_registerdump: R8: 0d10a9f4 0d10458c 00000000 00000000 00000064 0d10a728 0d01c60d 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: gnss_receiver: PID=7 Stack Used=284 of 1000 up_registerdump: R0: 00000002 0d10e664 0d108f44 0d10e664 0d10e5e0 000000e0 0d10ee80 0d10e538 up_registerdump: R8: 00000000 00000000 00000000 00000000 00000000 0d10ee50 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: init: PID=8 Stack Used=3044 of 8176 up_registerdump: R0: 00000002 0d10f1c4 0d103714 0d10f1c4 0d10f140 000000e0 000000df 00000001 up_registerdump: R8: 0d137b00 00000000 00000000 00000000 00000000 0d111550 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: frame_hdr_thread: PID=9 Stack Used=348 of 2048 up_registerdump: R0: 00000002 0d1095c4 0d10f1c4 0d1095c4 0d1094e0 0d111e44 0d109540 00000000 up_registerdump: R8: 0d1094e4 0d10458c 00000000 00000000 00000000 0d111e20 0d01c60d 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9 up_taskdump: cam_dq_thread: PID=10 Stack Used=564 of 1024 up_registerdump: R0: 00000002 0d109754 0d10f1c4 0d109754 0d1096d0 000000e0 0d10a830 000000e0 up_registerdump: R8: 0d10a878 0d10a840 00000080 00000000 00000000 0d112168 0d01cf6b 0d021cd0 up_registerdump: xPSR: 01000000 BASEPRI: 00000080 CONTROL: 00000000 up_registerdump: EXC_RETURN: ffffffe9
I think it's a stack size problem because when i just take one by one the input, there is no problem, but in a loop, i have this.
If you have any idea, that could help a lot !
Thanks
Simon -
Hey, @sisimonis-5-1-1
Here is a forum post that teaches you how to change stack size using the CLI:https://forum.developer.sony.com/topic/624/error-in-running-tflite-program/3
Try using 8192 for stack size.