having trouble with this code and this error message always appears: C:\Users\david\AppData\Local\Temp.arduinoIDE-unsaved2023125-1548-krtwrb.qn517\sketch_feb25a\sketch_feb25a.ino:2:10: fatal error: cstdarg: No such file or directory
#include
^~~~~~~~~
compilation terminated.
exit status 1
Compilation error: cstdarg: No such file or directory
here is the code i am trying to make work
#include <stdarg.h>
#include
#include <TinyMLShield.h>
#include <TensorFlowLite.h>
#include <Arduino_APDS9960.h>
#include <Arduino_LSM9DS1.h>
#include <Arduino_HTS221.h>
// Define the input and output layers of the neural network
const int input_nodes = 6;
const int output_nodes = 2;
// Define the number of hidden layers and nodes
const int num_layers = 2;
const int hidden_nodes = 10;
// Define the activation function for each layer
const tfl::ActivationFunctionType activation[num_layers+1] = {
tfl::ActivationFunctionType::kTfLiteActSigmoid,
tfl::ActivationFunctionType::kTfLiteActSigmoid,
tfl::ActivationFunctionType::kTfLiteActNone
};
// Define the loss function and optimizer for the neural network
const tfl::MicroMlOptimize::Type optimizer = tfl::MicroMlOptimize::kTfLiteMlOptimizeSgd;
const tfl::MicroMlModel::CompileOptions compile_options = {
.optimizer = optimizer,
.loss = tfl::MicroMlModel::kTfLiteMlLossMeanSquaredError
};
// Define the dataset of sensor readings and corresponding outputs
float inputs[NUM_SAMPLES][input_nodes];
float labels[NUM_SAMPLES][output_nodes];
void setup() {
// Initialize the sensors and collect data for the dataset
for (int i = 0; i < NUM_SAMPLES; i++) {
// Collect sensor readings and store in inputs[i]
// Collect corresponding output (e.g., robot movement) and store in labels[i]
}
// Define the neural network model
tfl::MicroMlModelRunner model_runner;
tfl::ErrorReporter* error_reporter = tfl::ArduinoErrorReporter();
const tfl::MicroMlModel* model = model_runner.CreateModel(error_reporter, input_nodes, output_nodes, num_layers, hidden_nodes, activation);
// Compile the neural network model
model_runner.Compile(model, compile_options);
// Train the neural network model on the dataset
model_runner.Train(inputs, labels, NUM_SAMPLES, 0);
// Save the trained neural network model to flash memory
model_runner.Save
