Comments (2)
Facts and general design
ONNX has two concepts of broadcasting:
- Multidirectional Broadcasting for trival Binary operators. This is very similar to NumPy's broadcasting rules.
- Unidirectional Broadcasting for some others that are layout sensitiave.
By intuition, we can do something like a fake broadcasting for shape such that the resulted shape is always broadcastable but layout propagation compatible, while element size remains unchanged. That is prepending or appending 1
to both input shapes of the inputs, therefore the resulted shapes have same length which can be moved around by layout propagation without impact the semantic.
That sounds faire enough but there is a significant challenge: fake broadcasting may break semantic of other operators as the rank of the tensors has changed. For this, we can insert Reshape
operator, the only open question is to transform the shape
attribution of Reshape
.
from tflite2onnx.
How to handle layout issue for Reshape
For Reshape
, regardless of whether it is newly added or raw in TFLite model, we need to try to fix the shape
attribution for it after layout propagation. Since the shape
attribution describes the shape of output tensor, if the output as propagated to transform layout, so as the shape
attribution.
The layouts for shape
could be obtained during parsing, but not always. If it is avaiable during parsing, then the shape
attribution (tensor actually) can be transformed directly. Otherwise, shape
has no layout information even after layout propagation (unless shape
is output of some other operators that have layout information, which is unusual case). For such issue, we perform sepcial handling in Reshape.transform()
to update the shape
tensor. Then, we are all set.
We may markup the layout of shape
and re-propagate the layouts, but that is unnecessary and complicate commen scenarios.
from tflite2onnx.
Related Issues (20)
- N/A
- NotImplementedError: Unsupported TFLite OP: 32 CUSTOM! HOT 2
- AssertionError: Per-tensor support only currently
- Operator request: Softplus Operator not supported HOT 1
- Operator request: 32 CUSTOM! HOT 5
- Unsupported TFLite OP: 53 CAST!
- Operator request: 83 PACK HOT 1
- Operator request:Div HOT 1
- NotImplementedError: Unsupported TFLite OP: 124 DENSIFY! HOT 1
- Operator request: TFLite OP: 98 LEAKY_RELU! HOT 1
- Operator request: SPLIT_V HOT 1
- Mediapipe face_landmark.tflite model conversion error HOT 1
- Unable to convert full integer quantised tflite model to onnx HOT 1
- NotImplementedError: Unsupported TFLite OP: 53 CAST!
- Operator request: NotImplementedError: Unsupported TFLite OP: 74 SUM!
- self.shape = [int(i) for i in tensor.ShapeAsNumpy()] TypeError: 'int' object is not iterable when doing convertion
- Operator request: 83, 105
- Data type float16 not supported/tested yet, the generated model may contain error HOT 1
- Error: Unsupported TFLite OP: 36 GATHEROperator request:
- Operator request: NotImplementedError: Unsupported TFLite OP: 83 PACK!
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 tflite2onnx.