Comments (4)
Hello @christian-steinmeyer
Arm NN has a Normalization layer
/armnn/src/armnn/layers/NormalizationLayer.cpp
Which error are you seeing? Maybe we are missing some parameter?
from armnn.
Hi! To add a bit of context, I'm working on pruning a tensorflow model and using xnnpack to accelerate inference with it on Android. To that end, I have a model (see below), convert it to tflite using tf.lite.Optimize.EXPERIMENTAL_SPARSITY
and run the tensorflow benchmark tool on it.
Here's the toy model I'm using:
model = keras.Sequential(
[
keras.layers.InputLayer(input_shape=(28, 28, 1)),
keras.layers.Conv2D(filters=12, kernel_size=(3, 3), activation='relu'),
keras.layers.MaxPooling2D(pool_size=(2, 2)),
keras.layers.Conv2D(1024, (7,7)),
keras.layers.Flatten(),
keras.layers.LayerNormalization(), # works without, but not with this normalization layer
keras.layers.Dense(10, activation="softmax"),
]
)
# ...
model_for_pruning = tfmot.sparsity.keras.prune_low_magnitude(model, **pruning_params)
model_for_pruning.fit(
# ...
)
pruned_model = tfmot.sparsity.keras.strip_pruning(model_for_pruning)
converter = tf.lite.TFLiteConverter.from_keras_model(pruned_model)
converter.optimizations = [tf.lite.Optimize.DEFAULT, tf.lite.Optimize.EXPERIMENTAL_SPARSITY]
converter.target_spec.supported_types = [tf.float16]
converter.allow_custom_ops = True
tflite_model = converter.convert()
When I include the LayerNormalization
layer, running the benchmark tool, I get the following log output: tflite : Failed to apply XNNPACK delegate.
vs Replacing 12 out of 12 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 1 partitions for the whole graph
without this layer.
I use this command to run the benchmark:
adb shell taskset f0 am start -S -n org.tensorflow.lite.benchmark/.BenchmarkModelActivity --es args '"--verbose=true --num_threads=1 --warmup_runs=100 --num_runs=100 --use_xnnpack=true --graph=/data/local/tmp/model.tflite"'
from armnn.
the XNNPACK delegate is one of the TensorFlow delegates, (see https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/delegates/xnnpack ) not the ArmNN delegate.
From looking at the XNNPACK page it doesn't seem like they support LayerNormalization yet but they may be able to help you there.
Best regards,
Mike
from armnn.
Thanks Mike!
I thought somehow armnn was responsible. Thanks for the pointer. I think this belongs to the tensorflow repo then. Best,
Chris
from armnn.
Related Issues (20)
- CpuAcc and GpuAcc not working (but CpuRef is) HOT 14
- Remove the workaround for gcc.99578? HOT 1
- Compilation Terminated Issue HOT 1
- Linker Error HOT 3
- ETA for prebuilt binary for Android 14? HOT 9
- How Armnn deal with unsupport operator by armnn_delegate HOT 5
- How to use the profiling data to improve my inference HOT 3
- Building delegate using Docker does not copy delegate includes to output tar HOT 2
- UnitTests Failed ! After Build success HOT 2
- How to close optimization of graph or save optimized graph in dot/tflite format when I run test/executeNetwork and set --tflite-executor as delegate? Does armnn provide options? HOT 4
- Do you have armnn profiling analyze tool? HOT 2
- Gather operator dimension check error HOT 10
- Armnn insert reshape node before fullyconnected HOT 4
- I want config the gpu core number for armnn HOT 3
- Explicit padding for Transpose Convolution fails HOT 8
- opencv failed to call opencl HOT 1
- ScatterND not support HOT 3
- Building ARM NN via Docker approach with specific GLIBC , GLIBCXX versions ... HOT 3
- Gather(ND) dim error HOT 1
- Link error on older Android devices HOT 8
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 armnn.