Comments (8)
Didn't really solve this but here is my research:
- TF_NUM_OPS eventually will go here as
tOpCount
- I am not experienced enough to explain it fully but by reading this it seems to be the number of "operations" that you add later by e.g. doing:
tf.resolver.AddFullyConnected();
ortf.resolver.AddSoftmax();
So, if you only add FullyConnected TF_NUM_OPS should be 1? I have the feeling this library here will be dropped anyways in favour of this one, which also uses the number of operations as argument....
Thank you for the information.
Is this the number of operations ? Is that means we needs to pre allocate memory before using each operation ?
from eloquenttinyml.
I would also be very interested in this. Unfortunately, I can't get my models to run with the update, but I don't know what should be entered there...
Thanks for the great work, Simone!
from eloquenttinyml.
Didn't really solve this but here is my research:
- TF_NUM_OPS eventually will go here as
tOpCount
- I am not experienced enough to explain it fully but by reading this it seems to be the number of "operations" that you add later by e.g. doing:
tf.resolver.AddFullyConnected();
ortf.resolver.AddSoftmax();
So, if you only add FullyConnected TF_NUM_OPS should be 1? I have the feeling this library here will be dropped anyways in favour of this one, which also uses the number of operations as argument....
from eloquenttinyml.
Just a short note as I understand some more things now and may be able to explain this partly:
There is a couple of possible operations in tflite. With TF_NUM_OPS
in this library (and also in others) you just reserve memory to do these operations.
Example:
When using a quantized model (taking in float, quantizing it to an int, running the inference and dequantize it back to a float) you would need TF_NUM_OPS
to be at least 3 because:
#define TF_NUM_OPS 3
#define ARENA_SIZE 2000
Eloquent::TF::Sequential<TF_NUM_OPS, ARENA_SIZE> tf;
void setup() {
//stuff
tf.resolver.AddFullyConnected();
tf.resolver.AddQuantize();
tf.resolver.AddDequantize();
}
with this you could load a quantized model like described here in the end
from eloquenttinyml.
Just a short note as I understand some more things now and may be able to explain this partly:
There is a couple of possible operations in tflite. With
TF_NUM_OPS
in this library (and also in others) you just reserve memory to do these operations.Example: When using a quantized model (taking in float, quantizing it to an int, running the inference and dequantize it back to a float) you would need
TF_NUM_OPS
to be at least 3 because:#define TF_NUM_OPS 3 #define ARENA_SIZE 2000 Eloquent::TF::Sequential<TF_NUM_OPS, ARENA_SIZE> tf; void setup() { //stuff tf.resolver.AddFullyConnected(); tf.resolver.AddQuantize(); tf.resolver.AddDequantize(); }with this you could load a quantized model like described here in the end
Thank you for your explanation. I wonder how do we know what operations are necessory for the model ?
from eloquenttinyml.
I also wonder why there seems to be no good docu about it.
If you train your model yourself, you can decide on its architecture and the operations you build in. When you have a tflite file and no knowledge you can use Netron to analyse the model. This is e.g. a tiny quantized tflite model I trained as a test. It has quantization built in as you can see in the screenshot and there is a correspinding AddFullyConnected
in the mentioned list.
Still I don't fully understand this: this model runs for example even if you just add a single AddFullyConnected()
and AddQuantize()
only (not multiple fully connected and dequantize).
from eloquenttinyml.
I also wonder why there seems to be no good docu about it. If you train your model yourself, you can decide on its architecture and the operations you build in. When you have a tflite file and no knowledge you can use Netron to analyse the model. This is e.g. a tiny quantized tflite model I trained as a test. It has quantization built in as you can see in the screenshot and there is a correspinding
AddFullyConnected
in the mentioned list. Still I don't fully understand this: this model runs for example even if you just add a singleAddFullyConnected()
andAddQuantize()
only (not multiple fully connected and dequantize).
I found a use way to summary the ops in a tflite model.
python -m tensorflow.lite.tools.visualize xxx.tflite
from eloquenttinyml.
I also wonder why there seems to be no good docu about it. If you train your model yourself, you can decide on its architecture and the operations you build in. When you have a tflite file and no knowledge you can use Netron to analyse the model. This is e.g. a tiny quantized tflite model I trained as a test. It has quantization built in as you can see in the screenshot and there is a correspinding
AddFullyConnected
in the mentioned list. Still I don't fully understand this: this model runs for example even if you just add a singleAddFullyConnected()
andAddQuantize()
only (not multiple fully connected and dequantize).
Thank you for providing the information. I found a easy way to summary the ops in a tflite model.
python -m tensorflow.lite.tools.visualize xxx.tflite
from eloquenttinyml.
Related Issues (20)
- Didn't find op for builtin opcode 'CONV_2D' version '5' Failed to get registration from op code d HOT 9
- predict function predict(input, output) supports either int/int or float/float.? HOT 5
- Update Platform.IO
- Files dependencies Arduino IDE 2.0.3 issue HOT 1
- Once model is loaded (ml.begin()), the HTTP client doesn't send request.
- TfLite' in namespace 'Eloquent::TinyML' does not name a template type HOT 4
- There is a problem with this program code, sir. EloquentTinyML/examples/2.4/PersonDetection/PersonDetection.ino HOT 2
- Does tensorflow need to know how the network is built? HOT 1
- FullyConnected Layers not Available in MutableTensorFlow HOT 1
- #if !defined(ESP32) HOT 3
- Compability Issues: Didn't find op for builtin opcode 'DEPTHWISE_CONV_2D' version '1' (Possibililty to integrate newer version?) HOT 1
- Support for STM H743 HOT 1
- Feature Request: Camera support for new Seeedstudio $14 XIAO-Esp32S3 HOT 1
- error: use of deleted function 'virtual Eloquent::TinyML::TensorFlow::AllOpsResolver HOT 1
- Feature request : ESP-NN in EloquentTinyML HOT 3
- Error compiling for Teensy 4.1 HOT 7
- Compatibility issue: Didn't find op for builtin opcode 'SHAPE' version '1' while allocating tensors HOT 1
- Compilation Error with EloquentTinyML Library on ESP32 DevKit V1 HOT 1
- Error when trying to run tflite model on Arduino Nano 33 BLE sense
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eloquenttinyml.