(ERROR) fmin and fmax not a member of 'std'

I’ve just created my first model, deployed it for Arduino IDE, and was about to compile it to my ESP32-CAM, but then I get these errors saying that the fmin and fmax are not a member of ‘std’. I’ve attached a picture that shows the error message.

I’ve already checked and read this long discussion ESP32 CAM Support where another user experienced the same thing. I’ve tried all the ways to fix this issue that were mentioned in the forum in the best of my abilities, like adding the “|| defined(ARDUINO)”, changing “fmax” to just “max” (same with fmin), and other ways, but I rather get this error, or being prompted by another one.

I’ve used the Advanced-Image-Classification.ino example from this link: example-esp32-cam/Examples/Advanced-Image-Classification at main · edgeimpulse/example-esp32-cam · GitHub to test my model, but I still run into the same error.

I’m a very beginner when it comes to ML, only learning from online articles and YouTube videos, so I would appreciate if someone can help me with this.

Hello @zerg_encenzo,

This example is deprecated, please use the example provided in the Arduino Library (from Edge Impulse Studio deployment page).

See also: Arduino library - Edge Impulse Documentation

Best,

Louis

1 Like

Hello @zerg_encenzo,
I had the same error. The solution was to change a little bit the file
…\tensor_utils_common.cpp. This file in the folder of the library that Edge Impulse creates
Original version
const double rmin = std::fmin(0, *(minmax.first));
const double rmax = std::fmax(0, *(minmax.second));
Modified version
const double rmin = fmin(0, *minmax.first);
const double rmax = fmax(0, *minmax.second);

The problem is because the functión fmin and fmax are not include in std but they are in so I use them from that library

I hope this information will be useful for you

1 Like

@louis But In librerie examples we dont have any example which can provide web dashbord like this example

@Jesus_A_Lopez this worked! Thanks alot!

Hey Louis thanks for the reply, sorry it took me so long to respond. I applied the solution Jesus_A_Lopez gave and it worked. However, I also considered what you said about the example being deprecated so to avoid any problems in the future, I started using the example provided by the library for the ESP32.

I encountered another problem, though I forgot what it was specifically, something about some things not being declared or something. However turns out I just needed to install the latest version of the ESP32 in the boards manager of the Arduino IDE. I was still using a 1.6 version, and once I updated to 2.0.8, the provided example in the library worked perfectly without any issues.

a bit unrelated with my original post, but I hope this helps other people :slight_smile:

2 Likes

Thanks a lot for providing that info, I hope that will help people too.

Best,

Louis