Kazuhito00 / Person-Detection-using-RaspberryPi-CPU

Raspberry Pi 4のCPU動作を想定した人検出モデルとデモスクリプト
36 stars 6 forks source link

run the model on NPU? #4

Closed adrejohan closed 2 months ago

adrejohan commented 2 months ago

Sorry for asking

is it possible to run this model on NPU using VX Delegate? I tried to run this model using C++ (possibility my code itself is the issue) but im encountering some issue

[Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". INFO: Vx delegate: allowed_cache_mode set to 0. INFO: Vx delegate: device num set to 0. INFO: Vx delegate: allowed_builtin_code set to 0. INFO: Vx delegate: error_during_init set to 0. INFO: Vx delegate: error_during_prepare set to 0. INFO: Vx delegate: error_during_invoke set to 0. Preprocess Completed Expected dimension: 1x3x192x192 Image dimension: 1x3x192x192 Set up Input Tensor Completed [New Thread 0xfffff146cf00 (LWP 1660)] E [/usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc:MapAxis:177]Map axis failed. detector_app: /usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc:178: uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector<unsigned int>&, uint32_t): Assertionfalse' failed.

Thread 1 "detector_app" received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 44 pthread_kill.c: No such file or directory. (gdb) bt

0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44

1 0x0000fffff69c0568 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78

2 0x0000fffff697acd0 in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.38+git-r0/sysdeps/posix/raise.c:26

3 0x0000fffff6966ef0 in __GI_abort () at abort.c:79

4 0x0000fffff69743f8 in __assert_fail_base (fmt=0xfffff6a8a8e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xfffff1ffdcf0 "false",

file=file@entry=0xfffff1fff568 "/usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc", line=line@entry=178,
function=function@entry=0xfffff1fff5d8 "uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector<unsigned int>&, uint32_t)") at assert.c:92

5 0x0000fffff6974470 in __assert_fail (assertion=0xfffff1ffdcf0 "false", file=0xfffff1fff568 "/usr/src/debug/tim-vx/1.1.88-r0/src/tim/transform/ops/op_layout_inference.cc", line=178,

function=0xfffff1fff5d8 "uint32_t tim::transform::OpLayoutInfer::MapAxis(const std::vector<unsigned int>&, uint32_t)") at assert.c:101

6 0x0000fffff1fa5f74 in tim::transform::OpLayoutInfer::MapAxis(std::vector<unsigned int, std::allocator > const&, unsigned int) () from /usr/lib/libtim-vx.so

7 0x0000fffff1f6a1b0 in ?? () from /usr/lib/libtim-vx.so

8 0x0000fffff1f4e5f4 in tim::transform::layout_inference_impl::HandleLayoutInfer(std::shared_ptr&, std::shared_ptr const&) () from /usr/lib/libtim-vx.so

9 0x0000fffff1f531f4 in tim::transform::LayoutInference(std::shared_ptr const&, std::shared_ptr&, std::map<std::shared_ptr, std::shared_ptr, std::less<std::shared_ptr >, std::allocator<std::pair<std::shared_ptr const, std::shared_ptr > > >) () from /usr/lib/libtim-vx.so

10 0x0000fffff23d85ac in vx::delegate::Delegate::Invoke(vx::delegate::OpData const&, TfLiteContext, TfLiteNode) () from /usr/lib/libvx_delegate.so

11 0x0000fffff7be9d9c in tflite::Subgraph::InvokeImpl() () from /usr/lib/libtensorflow-lite.so.2.14.0

12 0x0000fffff7bea388 in tflite::Subgraph::Invoke() () from /usr/lib/libtensorflow-lite.so.2.14.0

13 0x0000fffff7bd440c in tflite::impl::Interpreter::Invoke() () from /usr/lib/libtensorflow-lite.so.2.14.0

14 0x0000aaaaaaaa62e0 in Detector::detect (this=this@entry=0xfffffffff890, image=...)

at /home/ubuntu/imx-yocto-bsp/sdk/sysroots/armv8a-poky-linux/usr/include/c++/13.2.0/bits/unique_ptr.h:199

15 0x0000aaaaaaaa35b0 in main (argc=, argv=) at /home/ubuntu/imx-yocto-bsp/tflite_test/build_minim/main.cpp:29

`

Thank you in advance

Kazuhito00 commented 2 months ago

sorry. I am not aware of NPU.