Comments (8)
Hi @solderzzc the current tensorflow parser cannot guarantee the correct operation of control inputs (which is tensorflow's way of guaranteeing a particular order of execution).
You can try removing the code block at TfParser.cpp:489 to get past this parse error, but if the control inputs are guaranteeing execution of some variable assignment or something, you will probably just hit another parse error. The full list of supported TensorFlow ops is at: src/armnnTfParser/TensorFlowSupport.md
It seems to me that maybe it's not a frozen inference-only model? If you try following the steps at https://www.tensorflow.org/mobile/prepare_models it will remove all training-only nodes and you will have a much smaller, cleaner graph that is more likely to work with ArmNN.
All the best,
Matthew
from armnn.
Hi @MatthewARM
Thank for your reply. I removed the code block at TfParser.cpp to bypass parser error. The model has phase_train
(ref: davidsandberg/facenet#357 (comment)) to control graph inference flow, so it might has issue during runtime.
I also called optimize_for_inference
API of tensorflow to have training-only
nodes removed(same behavior as mentioned in https://www.tensorflow.org/mobile/prepare_models), then hit another error log:
terminate called after throwing an instance of 'armnn::ParseException'
what(): Currently only FLOAT is supported for tensorflow nodes (apart from Const)
Aborted
I think this is because that FLOAT variables were converted to CONST during Freeze Graph
phase.
Reference:
https://github.com/davidsandberg/facenet/blob/master/src/freeze_graph.py#L88
graph_util.convert_variables_to_constants(
sess, input_graph_def, output_node_names.split(","),
variable_names_whitelist=whitelist_names)
Thanks
Simba
from armnn.
Hi @solderzzc "Currently only FLOAT is supported for tensorflow nodes (apart from Const)" indicates that there is an integer operation in your network, do you know if that is the case? Currently we only support float operations.
If you can find out which operation, and what data type, it would help us prioritise the support work internally. Or we can find a workaround.
All the best,
Matthew
from armnn.
Hi, @MatthewARM
I just go through the network design of facenet, the non float
ops should come from dropout
layer of tensorflow.slim.
Network define with dropout
Slim dropout API
Best Regards
Simba
from armnn.
Hi @solderzzc, dropout should definitely get removed by the 'strip unused nodes' transform. Maybe you could try the mobile inference preparation steps again?
from armnn.
Hi @MatthewARM, I loaded the graph into tensorboard, the 'Dropout' layer is not included in the freezed graph. The issue should be introduced by DT_BOOL
phase_train
.
Added more information in TfPhaser.cpp line 1951:
type: 10 op: Placeholder name: phase_train
After replace phase_train into bool constant:
terminate called after throwing an instance of 'armnn::ParseException'
what(): Unknown DataType DT_BOOL for node
Aborted
After convert phase_train into FLOAT32(Just for bypass this exception):
terminate called after throwing an instance of 'armnn::ParseException'
what(): Unsupported operation Switch in tensorflow::GraphDef
Aborted
Thanks
Simba
from armnn.
Thanks for the detailed analysis, @solderzzc.
We can try to get a proper fix done in a future release, but I think you can work around the issue by removing all connections to 'phase_train' from your graph. In the ArmNN TensorFlow parser we will always assume that 'phase_train' is FALSE.
from armnn.
@MatthewARM I will try it and look forward for the next release.
Thanks
from armnn.
Related Issues (20)
- Profiler service warnings seen in ArmNN v24.02 HOT 4
- Does ExecuteNetwork support "GpuAcc" runtime ? HOT 13
- Running YOLOv5 ONNX model with onnx parser of armnn fails with unsupported operation HOT 2
- Crash when support ArmNN AIDL backend based on a shim over the NNAPI Support Library
- Crash when support ArmNN AIDL backend based on a shim over the NNAPI Support Library HOT 2
- Unitests failed HOT 3
- understanding the onnx parser HOT 2
- Whisper tflite doesn't work HOT 4
- Error compiling `OnnxMnist-Armnn.cpp` HOT 2
- How to set priority of the application running on GPU? HOT 2
- Onnx Parser: Function AddConvLayerWithDepthwiseConv with bias has logical error HOT 1
- memory alignment HOT 1
- Build-tool failure due to unaddressed -Werror=conversion HOT 4
- Arm NN Build Tool does not support 32-bit ARM v7 HOT 1
- UnidirectionalSequenceLSTMLayer's inferShape is wrong written! HOT 1
- `clGetEventProfileInfo` raises error in `ClConvolution2dWorkload` HOT 5
- Unable to execute GPT-2 onnx model HOT 6
- Model runs slower with ARM-NN than with XNNPACK on Cortex A53 HOT 1
- Avoid use of deprecated TfLiteRegistrationExternal HOT 7
- ArmNN 24.08 fails to build on armv7 with GCC14 HOT 6
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.