IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> TensorFlow Lite 单元测试编译和执行 -> 正文阅读

[人工智能]TensorFlow Lite 单元测试编译和执行

TensorFlow Lite 单元测试编译和执行

1. TensorFlow

(base) yongqiang@yongqiang:~/tensorflow_work$ git clone https://github.com/tensorflow/tensorflow.git
...
(base) yongqiang@yongqiang:~/tensorflow_work$

2. TensorFlow Lite 单元测试编译和执行

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/README.md

/home/yongqiang/tensorflow_work/tensorflow/tensorflow/lite/kernels/quantize.cc
/home/yongqiang/tensorflow_work/tensorflow/tensorflow/lite/kernels/quantize_test.cc
/home/yongqiang/tensorflow_work/tensorflow/tensorflow/lite/kernels/mirror_pad.cc
/home/yongqiang/tensorflow_work/tensorflow/tensorflow/lite/kernels/mirror_pad_test.cc

bazel test //tensorflow/lite/kernels/mirror_pad_test --distdir=/home/yongqiang/tensorflow_work/dist_dir/

(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$ bazel test //tensorflow/lite/kernels/mirror_pad_test --distdir=/home/yongqiang/tensorflow_work/dist_dir/

2.1 .bazelversion

(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$ bazel clean
ERROR: The project you're trying to build requires Bazel 3.7.2 (specified in /home/yongqiang/tensorflow_work/tensorflow/.bazelversion), but it wasn't found in /home/yongqiang/.bazel/bin.

Bazel binaries for all official releases can be downloaded from here:
  https://github.com/bazelbuild/bazel/releases

You can download the required version directly using this command:
  (cd "/home/yongqiang/.bazel/bin" && curl -fLO https://releases.bazel.build/3.7.2/release/bazel-3.7.2-linux-x86_64 && chmod +x bazel-3.7.2-linux-x86_64)
(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$

修改前:

(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$ cat .bazelversion
3.7.2
(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$

修改后:

(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$ cat .bazelversion
4.2.1
(base) yongqiang@yongqiang:~/tensorflow_work/tensorflow$

2.2 --distdir=/home/yongqiang/tensorflow_work/dist_dir/

WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Unknown host: storage.googleapis.com
WARNING: Download from https://github.com/tensorflow/runtime/archive/eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Unknown host: github.com

遇到编译时无法下载的库,使用浏览器或者 wget 放置到 /home/yongqiang/tensorflow_work/dist_dir/ 目录。

(base) yongqiang@yongqiang:~/tensorflow_work$ mkdir dist_dir
(base) yongqiang@yongqiang:~/tensorflow_work$ cd dist_dir/
(base) yongqiang@yongqiang:~/tensorflow_work/dist_dir$ ls
(base) yongqiang@yongqiang:~/tensorflow_work/dist_dir$ pwd
/home/yongqiang/tensorflow_work/dist_dir
(base) yongqiang@yongqiang:~/tensorflow_work/dist_dir$

(base) yongqiang@yongqiang:~/tensorflow_work/dist_dir$ wget https://github.com/tensorflow/runtime/archive/eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar.gz
--2021-11-18 23:34:30--  https://github.com/tensorflow/runtime/archive/eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar.gz
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/tensorflow/runtime/tar.gz/eeaa95e05ce236b56c960a3ec8e816c8d78c7106 [following]
--2021-11-18 23:34:31--  https://codeload.github.com/tensorflow/runtime/tar.gz/eeaa95e05ce236b56c960a3ec8e816c8d78c7106
Resolving codeload.github.com (codeload.github.com)... 20.205.243.165
Connecting to codeload.github.com (codeload.github.com)|20.205.243.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15257152 (15M) [application/x-gzip]
Saving to: ‘eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar.gz’

eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar 100%[=============================================================================================>]  14.55M  66.6KB/s    in 3m 39s

2021-11-18 23:38:12 (68.0 KB/s) - ‘eeaa95e05ce236b56c960a3ec8e816c8d78c7106.tar.gz’ saved [15257152/15257152]

(base) yongqiang@yongqiang:~/tensorflow_work/dist_dir$

References

https://www.tensorflow.org/lite/
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/g3doc

  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2021-11-19 17:37:57  更:2021-11-19 17:39:00 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/27 4:37:44-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码