I search in the forum for someone with this error and found this Error: 'to_string' is not a member of 'std'
But is not solved it.
I guess is something with the compiler, I’m using xtensa-esp32-elf-gcc as C/c++ compiler (by default).
Im using PlatformIO in linux tumbleweed machine.
Gastón
Interesting, I don’t even get to that point because the TensorFlow Lite library not installed
Compiling .pio/build/esp32dev/src/NeuralNetwork.cpp.o
src/NeuralNetwork.cpp:3:52: fatal error: tensorflow/lite/micro/all_ops_resolver.h: No such file or directory
Hi maxgerhardt,
I’m using the tfmicro folder thats is generated by compiling one of the examples in the tensorflow. The only 2 errors I got is those I posted in here. I tried changing the compilers in PlatformIO but is not working.
Gastón
in the C/C++ configuration I got:
for C standard : c17
for C++ standard : c++20
compiler path: /home/gaston/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc
I tried with others path in there to solve this errors, but none of them works (clang, clang++,gcc,g++ etc)
the erros is : lib/tfmicro/tensorflow/lite/kernels/kernel_util.cc:403:19: error: ‘to_string’ is not a member of ‘std’
when i open the error in the editor this line are marked:
std::to_string(shape->data[d]);
Gaston
And with what exact command did you do that? The build is failing for me.
I have a feeling that the used tensor version, together with what C++ standardlib features it uses, greatly influences this error. That is, in conjuction with the used toolchain (toolchain-xtensa32) and C++ standard version.
Have you for fun tried the 8.4.0 toolchain instead of the standard 5.2.0 by using
Compiling .pio\build\esp32dev\src\main.cpp.o
src\main.cpp: In function 'void setup()':
src\main.cpp:5:22: error: 'to_string' is not a member of 'std'
std::string test = std::to_string(123);
^
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 0.0.0+sha.371f382
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.80400.210114 (8.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
[..]
Indexing .pio\build\esp32dev\libFrameworkArduino.a
Linking .pio\build\esp32dev\firmware.elf
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Building .pio\build\esp32dev\firmware.bin
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 4.4% (used 14436 bytes from 327680 bytes)
Flash: [== ] 17.3% (used 226976 bytes from 1310720 bytes)
esptool.py v3.0
================== [SUCCESS] Took 11.83 seconds ==================
so the newest compiler + Arduino core work for me and std::to_string() is available… But this is surely not how it’s supposed to work. Surely the wrong TensorFlow library version must be at use here. I hope for an update in my opened issues soon.
there’s something wrong with my setup.
Gastón
P.S: funny thing, I can use platformio to program the esp32. I can’t use arduino to program the esp32 due to pyserial not found.
It’s probably doing an internal tasks rebuild and you clicked on build too fast. Try reopening VSCode and let the tasks fully reload, this may take some time due to arduino-esp32 being downloaded via git.
its working. I remove this line: lib_deps=tfmicro
and now its working. I didn’t find an update on tensorflow with platformio, only a video (2020) and the guy who did it, din’t answer my question about those errors.
Gastón
I upload the file in repository GitHub (i tried to do it in here but it was to large the file).
The name is TF-ESP32-Platformio. Let me know if you are able to find it. By the way is the first repository I made, let me know if I have to add something else in there to help others.
Regards
Gastón