Open Abdullah-Shahid01 opened 4 months ago
The recommended way to run TensorFlow models is detailed at https://eloquentarduino.com/posts/tensorflow-lite-tinyml-esp32. The post is focused on ESP32, but you can swap the TF runtime by chainging
#include <tflm_esp32.h>
with
#include <tflm_cortexm.h>
Let me know how it goes, since Cortex-M support is not 100% reliable.
Hi, I am trying to use the EloquentTensorFlowCortexM library to deploy a neural network model on the Sony Spresense, however, I am encountering an error which will not allow me to proceed. I have attached screenshots of the error message and my code here.
CODE:
include
include "irisModel.h"
define NUM_OPS 3
define ARENA_SIZE 2000
using Eloquent::CortexM::TensorFlow;
TensorFlow<NUM_OPS, ARENA_SIZE> tf;
void setup() { Serial.begin(115200); delay(2000);
Serial.println("TENSORFLOW IRIS");
tf.setNumInputs(4); tf.setNumOutputs(3);
tf.resolver.AddFullyConnected(); tf.resolver.AddSoftmax();
while (!tf.begin(irisModel).isOk()){ Serial.println(tf.exception.toString()); }
}
void loop() { if (!tf.predict(x0).isOk()) { Serial.println(tf.exception.toString()); return; }
}
ERROR:
/Users/abdullah/Documents/Arduino/libraries/EloquentTensorFlowCortexM/src/tensorflow/lite/micro/system_setup.cpp:68:39: error: expected template-name before '<' token 68 | class _RingBuffer : public RingBufferN<kSerialMaxInputLength + 1> { | ^ /Users/abdullah/Documents/Arduino/libraries/EloquentTensorFlowCortexM/src/tensorflow/lite/micro/system_setup.cpp:68:39: error: expected '{' before '<' token /Users/abdullah/Documents/Arduino/libraries/EloquentTensorFlowCortexM/src/tensorflow/lite/micro/system_setup.cpp:68:39: error: expected unqualified-id before '<' token /Users/abdullah/Documents/Arduino/libraries/EloquentTensorFlowCortexM/src/tensorflow/lite/micro/system_setup.cpp:73:20: error: aggregate 'test_over_serial::_RingBuffer test_over_serial::_ring_buffer' has incomplete type and cannot be defined 73 | static _RingBuffer _ring_buffer; | ^
~~~exit status 1
Compilation error: exit status 1