which was crashing after 3% of compiling to 100% compiling.
A simple change made the difference. The change in the toplevel CMakeLists.txt was
the fix.
[ 3%] Linking CXX executable output_handler_test.elf
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj: in function main': util_test.cpp:(.text.startup.main+0x0): multiple definition ofmain'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:output_handler_test.cpp:(.text.startup.main+0x0): first defined here
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): multiple definition of micro_test::reporter'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): multiple definition ofmicro_test::did_test_fail'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): first defined here
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): multiple definition of micro_test::is_test_complete'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): multiple definition ofmicro_test::tests_failed'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): first defined here
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/ut
[ 99%] Building C object tests/testing_helpers_test/CMakeFiles/testing_helpers_test.dir///pico-sdk/src/rp2_common/pico_stdio_uart/stdio_uart.c.obj
[ 99%] Building CXX object tests/testing_helpers_test/CMakeFiles/testing_helpers_test.dir///src/tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.cpp.obj
[100%] Linking CXX executable testing_helpers_test.elf
[100%] Built target testing_helpers_test
A tensor is a container which can house data in N dimensions. Often and erroneously used interchangeably
with the matrix (which is specifically a 2-dimensional tensor), tensors are generalizations of matrices
to N-dimensional space. Mathematically speaking, tensors are more than simply a data container, however.
Merge pull request #3 from raspberrypi/fix_hello_world_example
Update hello_world example so it compiles with the latest SDK
commit 2e6142b15b8a75c1227dd3edbe839193b2bf9041 (HEAD -> master, origin/master, origin/HEAD)
Author: graham sanderson graham.sanderson@raspberrypi.com
Date: Wed Jun 29 22:56:27 2022 -0500
SDK 1.4.0 release
08/16/22
git clone git@github.com:develone/pico-tflmicro.git -b dev
cd pico-tflmicro
git clone git@github.com:develone/pico-sdk.git
cd pico-sdk/
git submodule update --init
cd ../
mkdir build
cd build
export PICO_SDK_PATH=../pico-sdk/
cmake -DPICO_BOARD=pico ..
Using PICO_SDK_PATH from environment ('../pico-sdk/')
PICO_SDK_PATH is /home/devel/xx/pico-tflmicro/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
Build type is Release
PICO target board is pico.
Using board configuration from /home/devel/xx/pico-tflmicro/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/bin/python3.9 (found version "3.9.2") found components: Interpreter
TinyUSB available at /home/devel/xx/pico-tflmicro/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
cyw43-driver available at /home/devel/xx/pico-tflmicro/pico-sdk/lib/cyw43-driver
lwIP available at /home/devel/xx/pico-tflmicro/pico-sdk/lib/lwip
-- Configuring done
-- Generating done
-- Build files have been written to: /home/devel/xx/pico-tflmicro/build
make
[ 3%] Linking CXX executable output_handler_test.elf
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj: in function main': util_test.cpp:(.text.startup.main+0x0): multiple definition ofmain'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:output_handler_test.cpp:(.text.startup.main+0x0): first defined here
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): multiple definition of micro_test::reporter'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): multiple definition ofmicro_test::did_test_fail'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): first defined here
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): multiple definition of micro_test::is_test_complete'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): multiple definition ofmicro_test::tests_failed'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): first defined here
/usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test12tests_passedE+0x0): multiple definition of `micro_test::tests_passed'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test12tests_passedE+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: [examples/hello_world/CMakeFiles/output_handler_test.dir/build.make:2793: examples/hello_world/output_handler_test.elf] Error 1
make[1]: [CMakeFiles/Makefile2:3192: examples/hello_world/CMakeFiles/output_handler_test.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
two libs get created.
ls -la *.a
-rw-r--r-- 1 devel devel 1072296 Aug 15 09:21 libpico-tflmicro.a
-rw-r--r-- 1 devel devel 272188 Aug 15 09:18 libpico-tflmicro_test.a
-rw-r--r-- 1 devel devel 1311320 Aug 15 09:25 keyword_benchmark.dis
-rw-r--r-- 1 devel devel 689205 Aug 15 09:25 keyword_benchmark.elf.map
-rw-r--r-- 1 devel devel 209920 Aug 15 09:25 keyword_benchmark.uf2
minicom myusb0
Welcome to minicom 2.8
OPTIONS: I18n
Port /dev/ttyUSB0, 20:33:17
Press CTRL-A Z for help on special keys
InitializeKeywordRunner() took 3642 ticks (3 ms)
KeywordRunNIerations(1) took 7522 ticks (7 ms)
KeywordRunNIerations(10) took 70135 ticks (70 ms)
made the following chgs to the toplevel CMakeLists.txt file
This PR makes no sense, the title doesn't give any information what it is or why it is here... If you want to make a bug fix then rename and reduce the patches to whatever it is you are trying to create.
…elone/pico-tflmicro
which was crashing after 3% of compiling to 100% compiling. A simple change made the difference. The change in the toplevel CMakeLists.txt was the fix.
[ 3%] Linking CXX executable output_handler_test.elf /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj: in function
main': util_test.cpp:(.text.startup.main+0x0): multiple definition of
main'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:output_handler_test.cpp:(.text.startup.main+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): multiple definition ofmicro_test::reporter'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): multiple definition of
micro_test::did_test_fail'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): multiple definition ofmicro_test::is_test_complete'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): multiple definition of
micro_test::tests_failed'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/ut[ 99%] Building C object tests/testing_helpers_test/CMakeFiles/testing_helpers_test.dir///pico-sdk/src/rp2_common/pico_stdio_uart/stdio_uart.c.obj [ 99%] Building CXX object tests/testing_helpers_test/CMakeFiles/testing_helpers_test.dir///src/tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.cpp.obj [100%] Linking CXX executable testing_helpers_test.elf [100%] Built target testing_helpers_test
A tensor is a container which can house data in N dimensions. Often and erroneously used interchangeably with the matrix (which is specifically a 2-dimensional tensor), tensors are generalizations of matrices to N-dimensional space. Mathematically speaking, tensors are more than simply a data container, however.
commit 6ff6387ed1fb3b721b0996583c4af8872980833b (HEAD -> dev, origin/main, origin/dev, origin/HEAD) Merge: fbfff01 486abba Author: Alasdair Allan alasdair@raspberrypi.com Date: Tue Feb 23 09:00:00 2021 +0000
commit 2e6142b15b8a75c1227dd3edbe839193b2bf9041 (HEAD -> master, origin/master, origin/HEAD) Author: graham sanderson graham.sanderson@raspberrypi.com Date: Wed Jun 29 22:56:27 2022 -0500
08/16/22 git clone git@github.com:develone/pico-tflmicro.git -b dev
cd pico-tflmicro
git clone git@github.com:develone/pico-sdk.git
cd pico-sdk/
git submodule update --init
cd ../
mkdir build
cd build
export PICO_SDK_PATH=../pico-sdk/
cmake -DPICO_BOARD=pico .. Using PICO_SDK_PATH from environment ('../pico-sdk/') PICO_SDK_PATH is /home/devel/xx/pico-tflmicro/pico-sdk Defaulting PICO_PLATFORM to rp2040 since not specified. Defaulting PICO platform compiler to pico_arm_gcc since not specified. -- Defaulting build type to 'Release' since not specified. PICO compiler is pico_arm_gcc -- The C compiler identification is GNU 8.3.1 -- The CXX compiler identification is GNU 8.3.1 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/arm-none-eabi-gcc Build type is Release PICO target board is pico. Using board configuration from /home/devel/xx/pico-tflmicro/pico-sdk/src/boards/include/boards/pico.h -- Found Python3: /usr/bin/python3.9 (found version "3.9.2") found components: Interpreter TinyUSB available at /home/devel/xx/pico-tflmicro/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB. cyw43-driver available at /home/devel/xx/pico-tflmicro/pico-sdk/lib/cyw43-driver lwIP available at /home/devel/xx/pico-tflmicro/pico-sdk/lib/lwip -- Configuring done -- Generating done -- Build files have been written to: /home/devel/xx/pico-tflmicro/build
make
[ 3%] Linking CXX executable output_handler_test.elf /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj: in function
main': util_test.cpp:(.text.startup.main+0x0): multiple definition of
main'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:output_handler_test.cpp:(.text.startup.main+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): multiple definition ofmicro_test::reporter'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test8reporterE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): multiple definition of
micro_test::did_test_fail'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test13did_test_failE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): multiple definition ofmicro_test::is_test_complete'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test16is_test_completeE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir/__/__/src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): multiple definition of
micro_test::tests_failed'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test12tests_failedE+0x0): first defined here /usr/lib/gcc/arm-none-eabi/8.3.1/../../../arm-none-eabi/bin/ld: CMakeFiles/output_handler_test.dir///src/tensorflow/lite/micro/testing/util_test.cpp.obj:(.bss._ZN10micro_test12tests_passedE+0x0): multiple definition of `micro_test::tests_passed'; CMakeFiles/output_handler_test.dir/output_handler_test.cpp.obj:(.bss._ZN10micro_test12tests_passedE+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: [examples/hello_world/CMakeFiles/output_handler_test.dir/build.make:2793: examples/hello_world/output_handler_test.elf] Error 1 make[1]: [CMakeFiles/Makefile2:3192: examples/hello_world/CMakeFiles/output_handler_test.dir/all] Error 2 make: *** [Makefile:103: all] Error 2two libs get created.
ls -la *.a -rw-r--r-- 1 devel devel 1072296 Aug 15 09:21 libpico-tflmicro.a -rw-r--r-- 1 devel devel 272188 Aug 15 09:18 libpico-tflmicro_test.a
-rw-r--r-- 1 devel devel 1311320 Aug 15 09:25 keyword_benchmark.dis -rw-r--r-- 1 devel devel 689205 Aug 15 09:25 keyword_benchmark.elf.map -rw-r--r-- 1 devel devel 209920 Aug 15 09:25 keyword_benchmark.uf2
minicom myusb0
Welcome to minicom 2.8
OPTIONS: I18n Port /dev/ttyUSB0, 20:33:17
Press CTRL-A Z for help on special keys
InitializeKeywordRunner() took 3642 ticks (3 ms) KeywordRunNIerations(1) took 7522 ticks (7 ms) KeywordRunNIerations(10) took 70135 ticks (70 ms)
made the following chgs to the toplevel CMakeLists.txt file
${CMAKE_CURRENT_LIST_DIR}/src/tensorflow/lite/micro/testing/util_test.cpp
ls -la build/examples/hello_world/ total 22528 drwxr-xr-x 3 devel devel 4096 Aug 16 05:40 . drwxr-xr-x 7 devel devel 4096 Aug 15 09:17 .. drwxr-xr-x 5 devel devel 4096 Aug 16 05:34 CMakeFiles -rw-r--r-- 1 devel devel 1144 Aug 15 09:17 cmake_install.cmake -rwxr-xr-x 1 devel devel 317824 Aug 16 05:37 hello_world.bin -rw-r--r-- 1 devel devel 7380330 Aug 16 05:37 hello_world.dis -rwxr-xr-x 1 devel devel 714348 Aug 16 05:37 hello_world.elf -rw-r--r-- 1 devel devel 724383 Aug 16 05:37 hello_world.elf.map -rw-r--r-- 1 devel devel 894025 Aug 16 05:37 hello_world.hex -rwxr-xr-x 1 devel devel 308784 Aug 16 05:40 hello_world_test.bin -rw-r--r-- 1 devel devel 7203426 Aug 16 05:40 hello_world_test.dis -rwxr-xr-x 1 devel devel 547536 Aug 16 05:40 hello_world_test.elf -rw-r--r-- 1 devel devel 721797 Aug 16 05:40 hello_world_test.elf.map -rw-r--r-- 1 devel devel 868613 Aug 16 05:40 hello_world_test.hex -rw-r--r-- 1 devel devel 617984 Aug 16 05:40 hello_world_test.uf2 -rw-r--r-- 1 devel devel 635904 Aug 16 05:37 hello_world.uf2 -rw-r--r-- 1 devel devel 678122 Aug 16 05:34 Makefile -rwxr-xr-x 1 devel devel 26492 Aug 16 05:34 output_handler_test.bin -rw-r--r-- 1 devel devel 453709 Aug 16 05:34 output_handler_test.dis -rwxr-xr-x 1 devel devel 121272 Aug 16 05:34 output_handler_test.elf -rw-r--r-- 1 devel devel 672892 Aug 16 05:34 output_handler_test.elf.map -rw-r--r-- 1 devel devel 74589 Aug 16 05:34 output_handler_test.hex -rw-r--r-- 1 devel devel 53248 Aug 16 05:34 output_handler_test.uf2
-rw-r--r-- 1 devel devel 635904 Aug 16 05:37 hello_world.uf2 127
175
198
234
250
260
249
232
195
157
128
88
-rw-r--r-- 1 devel devel 617984 Aug 16 05:40 hello_world_test.uf2 Welcome to minicom 2.8
OPTIONS: I18n Port /dev/ttyUSB0, 21:06:53
Press CTRL-A Z for help on special keys
Testing LoadModelAndPerformInference 1/1 tests passed