构建TF micro hello world:制作:*** [tensorflow/lite/micro/examples/hello_world/Makefile.inc:34:test_hello_world_test]错误1 [英] Building TF micro hello world: make: *** [tensorflow/lite/micro/examples/hello_world/Makefile.inc:34: test_hello_world_test] Error 1

查看:103
本文介绍了构建TF micro hello world:制作:*** [tensorflow/lite/micro/examples/hello_world/Makefile.inc:34:test_hello_world_test]错误1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注Pete Warden和Daniel Situnayake撰写的TinyML书籍,其中介绍了如何使用TFLite用于微控制器将神经网络部署到微控制器.他们严格遵循此git回购末尾的说明.

I am following the TinyML book by Pete Warden and Daniel Situnayake on how to deploy neural networks to microcontrollers with TFLite for microcontrollers. They closely follow the instructions at the end of this git repo.

为了尝试检查错误,他们建议在开发机器(即我的PC)上测试代码,但是在运行"make"命令时会提示错误.我收到一些错误,但它没有建立.

To try and check for errors, they propose testing the code on the development machine(i.e my PC), but when running "make" I get some errors and it does not build.

跑步时 $ git clone --depth 1 https://github.com/tensorflow/tensorflow.git ,然后 $ make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test 我得到以下输出:

When running $ git clone --depth 1 https://github.com/tensorflow/tensorflow.git and then $ make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test I get the following output:

$ 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

尽管它说所有测试已通过",由于错误,它没有建立;当更改源文件以引入一些错误(以检查evcerything起作用)时,它仍会打印该消息.

Although it says "All tests passed" it did not build due to the errors; when changing the source file to introduce some errors(to check evcerything works) it still prints that message.

我尝试寻找类似的问题,但没有任何效果.这是有关我的PC的一些信息:

I've tried looking for similar issues but nothing worked. Here is some info about my PC:

  • Windows 10家庭版64位
  • GNU Make 4.3
  • gcc.exe(Rev5,由MSYS2项目构建)5.3.0
  • 已安装Conda
  • 控制台:Git Bash(MINGW64)
  • $ make $ gcc 都在PATH中
  • Windows 10 Home 64 bits
  • GNU Make 4.3
  • gcc.exe (Rev5, Built by MSYS2 project) 5.3.0
  • Conda is installed
  • Console: Git Bash (MINGW64)
  • Both $make and $gcc are in PATH

如果您需要更多信息,请告诉我.

Please let me know if you need more information and thank you.

推荐答案

我仍然必须在github上打开一个问题,因为我不认为这是预期的行为,但是这里有一个变通办法,可以让您测试TF micro开发计算机上的代码.

I still have to open an issue on github as I don't think this is the expected behavior but here is a workaround that allows you to test your TF micro code on your development machine.

第一步是转到刚刚克隆的git repo的根目录.然后,不是在make的目标上添加 test _ 前缀,而是"make".作为正常目标":

$ make -f tensorflow/lite/micro/tools/make/Makefile hello_world_test

根据您所运行的操作系统,可执行文件(输出)将位于不同的路径中,但只需将 windows_x86_64 更改为相应的文件夹即可.现在是时候运行输出了:

$ tensorflow/lite/micro/tools/make/gen/windows_x86_64/bin/hello_world_test.exe

如预期的那样返回:

First step is heading to the root of the git repo you just cloned. Then, instead of adding the test_ prefix to the target on make, just "make" it as a "normal target":

$ make -f tensorflow/lite/micro/tools/make/Makefile hello_world_test

Depending on the OS you are running, the executable(output) will be in different paths, but just change the windows_x86_64 to your corresponding folder. Now it is time to run the output:

$ tensorflow/lite/micro/tools/make/gen/windows_x86_64/bin/hello_world_test.exe

This returns, as expected:

Testing LoadModelAndPerformInference
1/1 tests passed
~~~ALL TESTS PASSED~~~

我已经用不同的组合和项目对其进行了测试,并且效果很好.Make似乎在生成测试文件后无法执行它,因此解决方案是在不同的步骤中完成它.

I've tested it with different combinations and projects and it works just fine. It seems like Make is having trouble executing the test file after generating it, so the solution was to do it in different steps.

请记住,您需要使版本3.82或更高版本才能起作用.如果您使用的是Windows.您可以使用Git Bash控制台并通过巧克力安装最新版本的Make.

Remember you need Make version 3.82 or later for this to work. If you are using Windows. you can use the Git Bash console and install the latest version of Make via chocolatey.

这篇关于构建TF micro hello world:制作:*** [tensorflow/lite/micro/examples/hello_world/Makefile.inc:34:test_hello_world_test]错误1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆