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)
- Assessment of the difficulty in porting CPU architecture for armnn HOT 1
- 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
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.