# TensorFlow Lite for Microcontrollers
This an experimental port of TensorFlow Lite aimed at micro controllers and
other devices with only kilobytes of memory. It doesn't require any operating
system support, any standard C or C++ libraries, or dynamic memory allocation,
so it's designed to be portable even to 'bare metal' systems. The core runtime
fits in 16KB on a Cortex M3, and with enough operators to run a speech keyword
detection model, takes up a total of 22KB.
## Table of Contents
- [Getting Started](#getting-started)
* [Getting Started with Portable Reference Code](#getting-started-with-portable-reference-code)
* [Building Portable Reference Code using Make](#building-portable-reference-code-using-make)
* [Building for the "Blue Pill" STM32F103 using Make](#building-for-the-blue-pill-stm32f103-using-make)
* [Building for "Hifive1" SiFive FE310 development board using Make](#building-for-hifive1-sifive-fe310-development-board-using-make)
* [Building for Ambiq Micro Apollo3Blue EVB using Make](#building-for-ambiq-micro-apollo3blue-evb-using-make)
* [Additional Apollo3 Instructions](#additional-apollo3-instructions)
* [Building for the Eta Compute ECM3531 EVB using Make](#Building-for-the-Eta-Compute-ECM3531-EVB-using-Make)
- [Goals](#goals)
- [Generating Project Files](#generating-project-files)
- [Generating Arduino Libraries](#generating-arduino_libraries)
- [How to Port TensorFlow Lite Micro to a New Platform](#how-to-port-tensorflow-lite-micro-to-a-new-platform)
* [Requirements](#requirements)
* [Getting Started](getting-started)
* [Troubleshooting](#troubleshooting)
* [Optimizing for your Platform](#optimizing-for-your-platform)
* [Code Module Organization](#code-module-organization)
* [Working with Generated Projects](#working-with-generated-projects)
* [Supporting a Platform with Makefiles](#supporting-a-platform-with-makefiles)
* [Supporting a Platform with Emulation Testing](#supporting-a-platform-with-emulation-testing)
* [Implementing More Optimizations](#implementing-more-optimizations)
# Getting Started
One of the challenges of embedded software development is that there are a lot
of different architectures, devices, operating systems, and build systems. We
aim to support as many of the popular combinations as we can, and make it as
easy as possible to add support for others.
If you're a product developer, we have build instructions or pre-generated
project files that you can download for the following platforms:
Device | Mbed | Keil | Make/GCC
---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | --------
[STM32F746G Discovery Board](https://www.st.com/en/evaluation-tools/32f746gdiscovery.html) | [Download](https://drive.google.com/open?id=1OtgVkytQBrEYIpJPsE8F6GUKHPBS3Xeb) | - | [Download](https://drive.google.com/open?id=1u46mTtAMZ7Y1aD-He1u3R8AE4ZyEpnOl)
["Blue Pill" STM32F103-compatible development board](https://github.com/google/stm32_bare_lib) | - | - | [Instructions](#building-for-the-blue-pill-stm32f103-using-make)
[Ambiq Micro Apollo3Blue EVB using Make](https://ambiqmicro.com/apollo-ultra-low-power-mcus/) | - | - | [Instructions](#building-for-ambiq-micro-apollo3blue-evb-using-make)
[Generic Keil uVision Projects](http://www2.keil.com/mdk5/uvision/) | - | [Download](https://drive.google.com/open?id=1Lw9rsdquNKObozClLPoE5CTJLuhfh5mV) | -
[Eta Compute ECM3531 EVB](https://etacompute.com/) | - | - | [Instructions](#Building-for-the-Eta-Compute-ECM3531-EVB-using-Make)
If your device is not yet supported, it may not be too hard to add support. You
can learn about that process
[here](#how-to-port-tensorflow-lite-micro-to-a-new-platform). We're looking
forward to getting your help expanding this table!
## Getting Started with Portable Reference Code
If you don't have a particular microcontroller platform in mind yet, or just
want to try out the code before beginning porting, the easiest way to begin is
by
[downloading the platform-agnostic reference code](https://drive.google.com/open?id=1cawEQAkqquK_SO4crReDYqf_v7yAwOY8).
You'll see a series of folders inside the archive, with each one containing just
the source files you need to build one binary. There is a simple Makefile for
each folder, but you should be able to load the files into almost any IDE and
build them. There's also a [Visual Studio Code](https://code.visualstudio.com/) project file already set up, so
you can easily explore the code in a cross-platform IDE.
## Building Portable Reference Code using Make
It's easy to build portable reference code directly from GitHub using make if
you're on a Linux or OS X machine with an internet connection.
- Open a terminal
- Download the TensorFlow source with `git clone
https://github.com/tensorflow/tensorflow.git`
- Enter the source root directory by running `cd tensorflow`
- Build and test the library with `make -f
tensorflow/lite/experimental/micro/tools/make/Makefile test`
You should see a series of compilation steps, followed by `~~~ALL TESTS
PASSED~~~` for the various tests of the code that it will run. If there's an
error, you should get an informative message from make about what went wrong.
These tests are all built as simple binaries with few dependencies, so you can
run them manually. For example, here's how to run the depthwise convolution
test, and its output:
```
tensorflow/lite/experimental/micro/tools/make/gen/linux_x86_64/bin/tensorflow/lite/experimental/micro/kernels/depthwise_conv_test
Testing SimpleTest
Testing SimpleTestQuantized
Testing SimpleTestRelu
Testing SimpleTestReluQuantized
4/4 tests passed
~ALL TESTS PASSED~~~
```
Looking at the
[depthwise_conv_test.cc](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/experimental/micro/kernels/depthwise_conv_test.cc)
code, you'll see a sequence that looks like this:
```
...
TF_LITE_MICRO_TESTS_BEGIN
TF_LITE_MICRO_TEST(SimpleTest) {
...
}
...
TF_LITE_MICRO_TESTS_END
```
These macros work a lot like
[the Google test framework](https://github.com/google/googletest), but they
don't require any dependencies and just write results to stderr, rather than
aborting the program. If all the tests pass, then `~~~ALL TESTS PASSED~~~` is
output, and the test harness that runs the binary during the make process knows
that everything ran correctly. If there's an error, the lack of the expected
string lets the harness know that the test failed.
So, why are we running tests in this complicated way? So far, we've been
building binaries that run locally on the Mac OS or Linux machine you're
building on, but this approach becomes important when we're targeting simple
micro controller devices.
## Building for the "Blue Pill" STM32F103 using Make
The goal of this library is to enable machine learn
没有合适的资源?快使用搜索试试~ 我知道了~
tensorflow-1.14.0.zip
共17021个文件
pbtxt:4470个
cc:4219个
py:3433个
需积分: 49 78 下载量 85 浏览量
2020-01-21
16:47:51
上传
评论
收藏 50.9MB ZIP 举报
温馨提示
这是从github下载的。网速慢,为急用且不差币的小伙伴提供。不急的同志们可以到github下载。这是开源的。
资源推荐
资源详情
资源评论
收起资源包目录
tensorflow-1.14.0.zip (17021个子文件)
Dockerfile.rbe.cuda10.0-cudnn7-centos6 3KB
00fd47bf73afcb72e7ed51bffd5f5fec 44B
010dc3d4b05288fcc40de2721052b3dc699f1cb3 233B
012e3ad384a4a1165f8498b5c94ba0d32a73e187 420B
013a29ea098a178f8a36741c9fd91144 747B
02cc44cdfec1d9d0d0c66c5a5f40d3d20e4c4c3a 11KB
Dockerfile.rbe.cuda9.0-cudnn7-ubuntu14.04 4KB
Dockerfile.rbe.cuda10.0-cudnn7-ubuntu14.04 4KB
0555cd5e9d99629819cc985285f80da0f00be1e9 474B
055d77f7810048caa28323f6eb552a53d156040b 594B
0875575fb76d630ccb19c5da8aab66b2 332B
087e1d7fae1c1ddcbaa3b5f822a171ad15498186 146B
0a0352aa168803ff65455792d9f6ee555c3e7c3f 232B
0ed54162df93ef8d00f993ce6b59ba422903d381 221B
0f61c33027394a0f14d29dcd22f405cad943b7cf 29KB
10cdebea1659c21a0248f88654ae41f62786abf1 57KB
126e68def9fd973a100e0f66cadf09448a716b57 9KB
1275d41ebf8788ce3a949352e4bc654b04012da3 70B
131e251bfb82c681cb075d32b99f18fceaca115d 287B
1399ab0bd9f2c91d270cb43251bdc5729bef3526 2KB
14908973e6720513a5f37676cb9fcc29 46B
1547b448171c700613c3946d730de496c9b9863f 260B
16a6ce88f66d2e9686c8354cad8ba915cf0c11de 207B
17859046cbe4ac598a645173d679ce2a52c6afba 525B
185097ed0588195164619ea930ddd8274a5f32ad 4KB
1a7f1c407fb3864ddb559f88f373a21d1be51584 35KB
1b0384bc2d5ac42b7425ac51c374f60c 228B
1c3e1c91f187f6bcea86f172ff5bbbd955a9654d 57B
1df76c07817fbc3653a26f34d97658e9973627c2 666B
1f0717f8856d7782e3ab7992d3a72d783a018443 122B
23b911e4ce936def88bc9a46b8b433c0e83fba2a 375B
25592201c3edff0578dbdac6b0e4f2be109ce151 329B
266fd8495e0b8eb64387c1a62264185e061fee73 360B
27711a87e06a50c81571c27c3aa403a6ad5dc55c 2KB
2779ba7c4d23eee9f79efa3660084c5d 45B
27f178cf415b4ff8671131ddf1d042dafac2fb3e 677B
298c3787ad1722b22569cbc405c464d2 4KB
2a0bdc4d9cc5ea5bb21dd256d6ac96075376a94f 246B
2b95ba6d8141ce0d29ff279770903922 4KB
2db83ea58639b6d7d585fa12e3947a82 10B
2e5d25add6adc68e0457b358c7a34abf3d41c938 165B
2e6c5b6a766dd5e9bd41eacfd0a36572bd2f7544 320B
2e9c935cf82f6ca640e9a9abc3c30a578ad46176 666B
2fcf1ed4477f7eaee028f5b3f9edeb5f1a737826 507B
300fe1e0a47543037cbf0243b6756c9aa48799c4 71KB
31ec5b0134bedcfe283f4978e6e65b7d35d5d4ad 26KB
321fb3d758b86e37fc340ae2b09b8ed9fa73a4cb 4KB
331a98b4e4c87840efea69223766ebd0e1736542 420B
3480713774f590908ca5dba16d121cdfb8fba62b 665B
352d73f841223ecb630b5836585d2ba7b0f9d883 2KB
36b4a931886b941dc41180050d12ca94 10B
38bd2bd767d0c4ddd531b3893080b952 2KB
39289afcec60d98802b333e0fbb1da4d7aed4ce5 247B
3a84f409d4c117edfdebc508cd23e8fc 3KB
3adc488e21d4aca7bed9422f0241a42d0f93e7d9 366B
3cbf274da522483dc991fad9df43a22ac4fb3173 474B
3d840cdff7f5ad16fe8bcb985ed4946c03459432 666B
3ef5cc982c0b45f69a26fd0f7d376415fdebabd1 220B
3f1e6753c1fca958e859189857449746592158ea 94B
3fa4075993cb0f9bfa8eea785174a2038a69aa1b 343B
401c7de8e122018a0e17f57c93db7ee49ab0e906 865B
4023a373e977be58413e55350380310c5dd1fd6a 241B
40caba69dce1cfc48e0e43184d2bfbc6daa4399a 470B
41438a3c1c77c64a2f0840a2427f8834 30B
41841e9561d8135945c1c1e55ab9e9a1e933653b 247B
41d40f2d66fa43e34537385594ee9911e65deadf 677B
421bd39810b50309a71adb2dadc3b19f01a52312 221B
446c305b2c0665736f94fb2b62dbdef445eff0cf 174B
449cee952bb645f6f4241a6665d3c6028c073c7a 374B
45520b07609978c5aa3516d803527438b93fbadb 158B
4c01a1504da9de2216894743ecc44424 45B
4da74a34bcede234b0415f77fbd87d70bf9a777e 94B
4e7cbb27667bcfca92838aa8020749990013a9b1 65KB
50a2fabfdd276f573ff97ace8b11c5f4 3B
51db5d31d2c5300d34831d9f23bcdd0aff9a998b 677B
52fee71bb8c9c79068e1fe580677ad739a2d0415 361B
57b11507813d5727b7789354d888eda83d5f3d86 3KB
57dff0fa53ee0ef24a43cca6ab0523bfdc1f720d 864B
585e469231d202812bfba8285fb30c8e31c857b9 69KB
58eab6bc2386e2ef43fe4f55cb6ad3611399d5de 22B
5b0e5f8d2990c3cac80fa792ba141c43 10B
5b61fa3a30dd267828f12d9ea2b2a191 13B
5bf16424630b5afbcffe711fb9834440 43B
5bf16424630b5afbcffe711fb9834440 43B
5c42d3df0dc400a7a4175b8d4eec6cc8ee2437b2 2KB
5cca20637ae75fddad9370ee930837baef8aeb43 4KB
5cde2a9167798cb77f10abbfb2640a5c357f99fc 507B
5d34bc9cef0c844b9c5ebe948145c4ca11b5ca09 3KB
5e162fe883bd12fb1c4131d4e0c979a12bd15eac 76B
5e352fc10ac476cfbe1d755f092e069820223249 169B
5e83f8faab9c1a51a33d5e29edbb9dcec23c6092 1KB
61b29dc2fcef7b6fbe3e0cc88769a7ef 3KB
62edb2a1eee34b001652cd86584becf2 9B
63448c6a9feb8c72b3e82af4d735ec2e62ddd328 57KB
6361eca190157ece389665ee523ccc3aefcd957f 4KB
63661677dd1306cec4b5a565190e65adf2446e52 374B
65150515ab3b11d657519b22bb887d74e94b2d7f 4KB
656f38ef6dcd58c6a909d61db11f777def69c394 1KB
65887ed3db382aab1d9485c500f4401318d303b9 224B
66e0d2cafd592bf9d61ad900fade8ee530d5f3d7 203B
共 17021 条
- 1
- 2
- 3
- 4
- 5
- 6
- 171
资源评论
qq_36553515
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功