Showing posts with label Tensorflow Lite. Show all posts
Showing posts with label Tensorflow Lite. Show all posts

Thursday, June 30, 2022

[TensorFlow Lite] TensorFlow Lite 有用的工具

TensorFlow Lite Tool: Toco (轉換器)

toco是用來生成一個可供TensorFlow Lite框架使用tflite文件。

bazel 編譯方式
$ bazel build tensorflow/lite/toco:toco

程式位於tensorflow/lite/toco資料夾下。Toco有三個主要功能,即匯入、匯出和轉換。匯入將輸入轉為Model類別,匯出將模型轉為flite模型或是grpahviz。轉換以輸入標示為基礎對模型操作,並且它會刪除未使用的運算元等。

Wednesday, April 10, 2019

[TensorFlow Lite] The performance experiment of TensorFlow Lite

Based on my previous post: [TensorFlow Lite] My first try with TensorFlow Lite ,
I am just curious about the performance of TensorFlow Lite on the different platforms so that I do a performance experiment for it.
There are a X86 server (no GPU enabled) and a Nvidia TX2 board ( which is ARM based ) to do the experiment. They both run TFLite’s official example using Inception_v3 model and get average inference time as the following table.

Hardware Information:
Nvidia TX2: 4 CPU cores and 1 GPU ( but does not use )
X86 server: 24 CPU cores and no GPU enabled

Wednesday, March 27, 2019

[TensorFlow Lite] Build Tensorflow Lite C++ shared library

Build Tensorflow Lite shared library:

Modify the code: tensorflow/contrib/lite/BUILD in TensorFlow source:
cc_binary(
    name = "libtflite.so",
    deps = [":framework",
        "//tensorflow/contrib/lite/kernels:builtin_ops",
        "//tensorflow/contrib/lite/kernels:eigen_support",
        "//tensorflow/contrib/lite/kernels:gemm_support",
    ],
    linkopts=["-shared -Wl,--whole-archive" ],
    linkshared=1

)