【发布时间】:2020-08-14 22:42:24
【问题描述】:
我正在关注 Pete Warden 和 Daniel Situnayake 所著的 TinyML 书籍,其中介绍了如何使用 TFLite 将神经网络部署到微控制器。他们严格按照this git repo 末尾的说明进行操作。
为了尝试检查错误,他们建议在开发机器(即我的 PC)上测试代码,但是在运行“make”时我遇到了一些错误并且无法构建。
跑步时
$ git clone --depth 1 https://github.com/tensorflow/tensorflow.git 然后$ make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test
我得到以下输出:
$ make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test
tensorflow/lite/micro/tools/make/Makefile:305: warning: overriding recipe for target 'tensorflow/lite/micro/tools/make/downloads/ruy'
tensorflow/lite/micro/tools/make/Makefile:305: warning: ignoring old recipe for target 'tensorflow/lite/micro/tools/make/downloads/ruy'
tensorflow/lite/micro/tools/make/Makefile:305: warning: overriding recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_grayscale'
tensorflow/lite/micro/tools/make/Makefile:305: warning: ignoring old recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_grayscale'
tensorflow/lite/micro/tools/make/Makefile:305: warning: overriding recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_int8'
tensorflow/lite/micro/tools/make/Makefile:305: warning: ignoring old recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_int8'
g++ -std=c++11 -DTF_LITE_STATIC_MEMORY -Werror -Wsign-compare -Wdouble-promotion -Wshadow -Wunused-variable -Wmissing-field-initializers -Wunused-function -DNDEBUG -O3 -I. -Itensorflow/lite/micro/tools/make/downloads/ -Itensorflow/lite/micro/tools/make/downloads/gemmlowp -Itensorflow/lite/micro/tools/make/downloads/flatbuffers/include -Itensorflow/lite/micro/tools/make/downloads/ruy -Itensorflow/lite/micro/tools/make/downloads/kissfft -o tensorflow/lite/micro/tools/make/gen/windows_x86_64/bin/hello_world_test tensorflow/lite/micro/tools/make/gen/windows_x86_64/obj/tensorflow/lite/micro/examples/hello_world/hello_world_test.o tensorflow/lite/micro/tools/make/gen/windows_x86_64/obj/tensorflow/lite/micro/examples/hello_world/model.o tensorflow/lite/micro/tools/make/gen/windows_x86_64/lib/libtensorflow-microlite.a -lm
tensorflow/lite/micro/testing/test_linux_binary.sh tensorflow/lite/micro/tools/make/gen/windows_x86_64/bin/hello_world_test '~~~ALL TESTS PASSED~~~'
make: *** [tensorflow/lite/micro/examples/hello_world/Makefile.inc:34: test_hello_world_test] Error 1
虽然它说“所有测试都通过了”,但由于错误,它没有构建;当更改源文件以引入一些错误(检查一切是否正常)时,它仍然会打印该消息。
我尝试寻找类似的问题,但没有任何效果。以下是关于我的电脑的一些信息:
- Windows 10 家庭版 64 位
- GNU Make 4.3
- gcc.exe (Rev5, Built by MSYS2 project) 5.3.0
- Conda 已安装
- 控制台:Git Bash (MINGW64)
-
$make和$gcc都在 PATH 中
如果您需要更多信息,请告诉我,谢谢。
【问题讨论】:
-
看起来
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/testing/test_linux_binary.sh中的某些内容以错误终止而没有消息。我会向它添加调试打印,看看它什么时候开始繁荣。 -
注意
~~~ALL TESTS PASSED~~~是a regular expression that's required to be in the output logs。该字符串在测试日志中被 grep,以查看是否所有测试都通过了。对于任何阅读本文的人:不要那样做。 -
我添加了一些调试打印,但我仍然得到相同的输出。由于先前的错误,我认为程序无法运行。我也将 gcc 更新到 8.2.0,但没有任何变化。
-
可能是张量流“管理”以某种方式输出错误。我会在github.com/tensorflow/tensorflow/issues 上打开一个问题
-
我一定会的;我找到了一些解决方法,但并不完全。甚至在 Ubuntu 上尝试过并遇到了类似的问题。当(如果)问题得到解决时,我会发布答案。谢谢。
标签: c++ tensorflow makefile gnu-make tensorflow-lite