TinyML Book 페이지 130을 진행하다가 Error 발생함
joongoes opened this issue · 11 comments
TinyML: Tensorflow lite for microcontroller 이슈
이곳은 텐서플로우 라이트 한글화 프로젝트의 Issue 공간입니다. 텐서플로우 자체에 이슈가 있다면 아래의 Github 링크나 Stack Overflow를 참조하시기 바랍니다.
에러로그
- 이슈내용: 페이지 130을 진행하다가 Error 발생함(issue#83과 동일한 현상으로 보임)
- 재현과정:
- 재현환경: OSX, Makefile Version : 4.3
- 에러로그
(base) ➜ tensorflow git:(master) ✗ make -f tensorflow/lite/micro/tools/make/Makefile hello_world
tensorflow/lite/micro/tools/make/Makefile:401: warning: overriding recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_int8'
tensorflow/lite/micro/tools/make/Makefile:401: warning: ignoring old recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_int8'
g++ -std=c++11 -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-unwind-tables -ffunction-sections -fdata-sections -fmessage-length=0 -DTF_LITE_STATIC_MEMORY -O3 -Werror -Wsign-compare -Wdouble-promotion -Wshadow -Wunused-variable -Wmissing-field-initializers -Wunused-function -Wswitch -Wvla -Wall -Wextra -Wstrict-aliasing -Wno-unused-parameter -DTF_LITE_DISABLE_X86_NEON -DTF_LITE_DISABLE_X86_NEON -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 -c tensorflow/lite/micro/examples/hello_world/main.cc -o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/main.o
g++ -std=c++11 -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-unwind-tables -ffunction-sections -fdata-sections -fmessage-length=0 -DTF_LITE_STATIC_MEMORY -O3 -Werror -Wsign-compare -Wdouble-promotion -Wshadow -Wunused-variable -Wmissing-field-initializers -Wunused-function -Wswitch -Wvla -Wall -Wextra -Wstrict-aliasing -Wno-unused-parameter -DTF_LITE_DISABLE_X86_NEON -DTF_LITE_DISABLE_X86_NEON -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 -c tensorflow/lite/micro/examples/hello_world/main_functions.cc -o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/main_functions.o
g++ -std=c++11 -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-unwind-tables -ffunction-sections -fdata-sections -fmessage-length=0 -DTF_LITE_STATIC_MEMORY -O3 -Werror -Wsign-compare -Wdouble-promotion -Wshadow -Wunused-variable -Wmissing-field-initializers -Wunused-function -Wswitch -Wvla -Wall -Wextra -Wstrict-aliasing -Wno-unused-parameter -DTF_LITE_DISABLE_X86_NEON -DTF_LITE_DISABLE_X86_NEON -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 -c tensorflow/lite/micro/examples/hello_world/output_handler.cc -o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/output_handler.o
g++ -std=c++11 -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-unwind-tables -ffunction-sections -fdata-sections -fmessage-length=0 -DTF_LITE_STATIC_MEMORY -O3 -Werror -Wsign-compare -Wdouble-promotion -Wshadow -Wunused-variable -Wmissing-field-initializers -Wunused-function -Wswitch -Wvla -Wall -Wextra -Wstrict-aliasing -Wno-unused-parameter -DTF_LITE_DISABLE_X86_NEON -DTF_LITE_DISABLE_X86_NEON -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 -c tensorflow/lite/micro/examples/hello_world/constants.cc -o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/constants.o
g++ -std=c++11 -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-unwind-tables -ffunction-sections -fdata-sections -fmessage-length=0 -DTF_LITE_STATIC_MEMORY -O3 -Werror -Wsign-compare -Wdouble-promotion -Wshadow -Wunused-variable -Wmissing-field-initializers -Wunused-function -Wswitch -Wvla -Wall -Wextra -Wstrict-aliasing -Wno-unused-parameter -DTF_LITE_DISABLE_X86_NEON -DTF_LITE_DISABLE_X86_NEON -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/osx_x86_64/bin/hello_world tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/main.o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/main_functions.o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/model.o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/output_handler.o tensorflow/lite/micro/tools/make/gen/osx_x86_64/obj/tensorflow/lite/micro/examples/hello_world/constants.o tensorflow/lite/micro/tools/make/gen/osx_x86_64/lib/libtensorflow-microlite.a -Wl,--fatal-warnings -Wl,--gc-sections -lm -framework Foundation -framework AudioToolbox
ld: unknown option: --fatal-warnings
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tensorflow/lite/micro/examples//hello_world/Makefile.inc:42: tensorflow/lite/micro/tools/make/gen/osx_x86_64/bin/hello_world] Error 1
Tensorflow Github
Stack Overflow
@joongoes 안녕하세요. 확인해보았는데 에러가 재현되지 않습니다. 다음을 확인해주세요
-
테스트 커맨드
make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world
-
테스트 환경: OSX Mojave 10.14.6, GNU Make 4.3 Built for x86_64-apple-darwin18.7.0, Python 3.7.9
문제가 계속된다면 p434에 나오는 13.1.4 요구사항을 충족시켰는지 확인해보세요.
-
빌드 커맨드
참고로 코드를 git clone 하실 때, 공식 tensorflow 레포가 아니라 이 레포에서 받은 경로로 가셔야 합니다.
make -f tensorflow/lite/micro/tools/make/Makefile hello_world
-
빌드 성공시
- 빌드한 결과물 실행 (chmod로 실행권한 주고 ./hello_world로 실행)
답변감사합니다.
테스트 환경은 크게 차이가 없는 것으로 보입니다. 제가 가지고 있는 맥미니에서도 똑같은 현상이 일어 나는데요.
위 코멘트에서 "참고로 코드를 git clone 하실 때, 공식 tensorflow 레포가 아니라 이 레포에서 받은 경로로 가셔야 합니다."라고 하셨는데,
저는 책에 나와 있는 명령 "git clone https://github.com/tensorflow/tensorflow.git"을 써서 다운 받았습니다. 이렇게 다운 받고 난 뒤 파일들을 보면 정상적으로 다운로드 된 것으로 보입니다만, 이렇게 받으면 안된다는 말씀이신지요?
위에서 빌드하신 내용을 보면 제가 한 것과 차이 점이 있어 보입니다. 저는 아래 캡쳐한 부분과 같이 warning 이 나옵니다. 혹시 Makefile 이 다른 건 아닐까요?
tensorflow/lite/micro/tools/make/Makefile:400: warning: overriding recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_int8'
tensorflow/lite/micro/tools/make/Makefile:400: warning: ignoring old recipe for target 'tensorflow/lite/micro/tools/make/downloads/person_model_int8'
git clone 으로 다운 받은 Makefile로 실행시 모든 옵션이 다 들어옵니다. 그래서 capture 해주신 g++ 옵션으로 빌드하니 문제없이 실행됩니다. 하지만 이것도 실행 후 출력되는 문구('All TESTS PASSED' vs. 'PASS')가 일부 다릅니다. 저는 그냥 'PASS'만 나옵니다.
따라서, 이후 예제에서도 테스트를 실행할 때마다 일일이 빌드 명령 라인을 수작업으로 만들어 주고 있습니다.
"git clone https://github.com/tensorflow/tensorflow.git" 을 받고, "cd tensorflow"을 가서 아래의 command을 사용하면 동일하게
Error가 발생합니다.
- make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test
- make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world
- make -f tensorflow/lite/micro/tools/make/Makefile hello_world_test
- make -f tensorflow/lite/micro/tools/make/Makefile hello_world
"공식 tensorflow 레포가 아니라 이 레포에서 받은 경로로 가셔야 합니다."가 무슨 의미인지 알려주시면 감사하겠습니다. 'git clone https://github.com/tensorflow/tensorflow.git' 으로 받은 레포 속에 경로를 알려주는 무언가가 있다는 말씀이신지요?
일단, 저는 'git checkout r1.9'(r1.5까지 설정 해봄)와 같이 이전 버전의 경로를 설정해 봤습니다만 안되긴 마찬가지입니다.
@jaeho77 @joongoes git clone https://github.com/yunho0130/tensorflow-lite/ 으로 하세요 책에 각주에도 makefile 경로에서 확인하실 수 있어요
감사합니다. 알려주신 경로로 실행해서 정상동작합니다.
@yunho0130 Hello, I've checked your github because I have the same problem. I have to use haimax-we1 board. But in your github there isn't. Do you have plane to add haimax-we1 board?