second-state / WasmEdge-tensorflow

12 stars 5 forks source link

Library Load Failures and Plugin Installation Error for WasmEdge TensorFlow Lite Example on Android #4

Open mtobin-tdab opened 7 months ago

mtobin-tdab commented 7 months ago

I am attempting to run his example in android. I've build WasmEdge for android with the wasi-nn plugin and am able to execute simple .wasm files.

However when I run the example which uses libtensorflowlite I get the following error:

 arm64-v8a/bin/wasmedge --dir .:. wasmedge-wasinn-example-tflite-bird-image.wasm example/tflite-birds_v1-image/lite-model_aiy_vision_classifier_birds_V1_3.tflite bird.jpg
[2024-03-22 08:38:41.717] [error] loading failed: invalid path, Code: 0x100
[2024-03-22 08:38:41.733] [error]     load library failed:dlopen failed: library "libtensorflowlite_c.so" not found: needed by /data/local/tmp/OctaiDroid/arm64-v8a/lib/libwasmedgePluginWasiNN.so in namespace (default)
[2024-03-22 08:38:41.767] [error] loading failed: invalid path, Code: 0x100
[2024-03-22 08:38:41.768] [error]     load library failed:dlopen failed: "/data/local/tmp/OctaiDroid/example/tflite-birds_v1-image/rust/target/release/deps/libthiserror_impl-fd4f684432214163.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
[2024-03-22 08:38:41.796] [error] loading failed: invalid path, Code: 0x100
[2024-03-22 08:38:41.797] [error]     load library failed:dlopen failed: library "libtensorflowlite_c.so" not found: needed by /data/local/tmp/OctaiDroid/libwasmedgePluginWasiNN.so in namespace (default)
[2024-03-22 08:38:41.806] [error] loading failed: invalid path, Code: 0x100
[2024-03-22 08:38:41.806] [error]     load library failed:dlopen failed: library "libtensorflowlite_c.so" not found: needed by /data/local/tmp/OctaiDroid/arm64-v8a/lib/libwasmedgePluginWasiNN.so in namespace (default)
[2024-03-22 08:38:41.811] [error] loading failed: invalid path, Code: 0x100
[2024-03-22 08:38:41.812] [error]     load library failed:dlopen failed: "/data/local/tmp/OctaiDroid/example/tflite-birds_v1-image/rust/target/release/deps/libthiserror_impl-fd4f684432214163.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
[2024-03-22 08:38:41.821] [error] loading failed: invalid path, Code: 0x100
[2024-03-22 08:38:41.821] [error]     load library failed:dlopen failed: library "libtensorflowlite_c.so" not found: needed by /data/local/tmp/OctaiDroid/libwasmedgePluginWasiNN.so in namespace (default)
Read graph weights, size in bytes: 3561598
[2024-03-22 08:38:42.607] [error] WASI-NN plugin not installed. Please install the plugin and restart WasmEdge.
Error: BackendError(InvalidArgument)

I have both WASMEDGE_PLUGIN_PATH and LD_LIBRARY_PATH set to directories containing libwasmedgePluginWasiNN.so and libtensorflowlite_c.so respectively. Am I missing something here? Does anyone have an idea what is going on?

hydai commented 6 months ago

What's the output of ldd to the WasmEdge binary and the plugin's shared library?