google-coral / libcoral

C++ API for ML inferencing and transfer-learning on Coral devices
https://coral.ai
Apache License 2.0
84 stars 44 forks source link

how to install the compile lib #21

Closed timocafe closed 2 years ago

timocafe commented 2 years ago

Description

Hello,

I succeed to make inference using python on the coral TPU on my own model. However I would like use the C++ API for performance issue. The coral website give example and some indication , I compile the library on my mac and then ? There is no target make install or any indication of which files I should copy between my mac and the TPU. I need tflite (include and lib), the runtime edgtpu and maybe something else.

So does somebody could indicate me which files I should copy to the TPU ? A update of the README will be very nice too.

Thank you

Click to expand! ### Issue Type Support ### Operating System Mac OS ### Coral Device Dev Board Mini ### Other Devices _No response_ ### Programming Language C++ ### Relevant Log Output _No response_
Namburger commented 2 years ago

@timocafe with bazel you can point to libedgetpu as a dependency in a WORKSPACE file, take a look at how it is done in this example: https://github.com/google-coral/examples-camera/tree/master/nativeapp

Cheers!

timocafe commented 2 years ago

oki so cross compilation and scp ...

timocafe commented 2 years ago

OK I have been able to compile the app, indeed it is a tpu binary (check with ldd), I have no Usb cam so I can not really test it. However a few questions, I do not see any trace of the edgelib, tflite, does bazel did a static lib and included into the binary ?

Does it exist a way to speed up the compilation, the first run was slow due to setup. However if I recompile, bazel "re-fetch" everything and it look likes it recompiles flat buffer, tflite ... So a single compile takes 100 [s] ... :-/ Cheers

timocafe commented 2 years ago

find I can start a shell inside the docker, just have to compile tflite once.

google-coral-bot[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No

timocafe commented 2 years ago

Ok the strategy is to make a binary on my mac and copy it on the TPU. Bazel will do the cross compiling. Let's see ..

Le jeu. 26 mai 2022 à 22:56, Nam Vu @.***> a écrit :

@timocafe https://github.com/timocafe with bazel you can point to libedgetpu as a dependency in a WORKSPACE file, take a look at how it is done in this example: https://github.com/google-coral/examples-camera/tree/master/nativeapp

Cheers!

— Reply to this email directly, view it on GitHub https://github.com/google-coral/libcoral/issues/21#issuecomment-1139039553, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMN3UP6PBAFKFD4C7JO6VDVL7QODANCNFSM5XCHL6YQ . You are receiving this because you were mentioned.Message ID: @.***>