Comments (5)
The plan is:
- to write a (red) test in
onnx-go
based on the structure in the comment - make the test pass by modifying the onnx decoder
- write a similar test in
gorgonnx
- make the test pass.
from onnx-go.
Hello,
Many thanks for submitting this issue and for your investigation.
I will have a closer look at the bug as soon as.possible.
First step is to write a simple test to reproduce this.
It will ease the analysis and the debugging process.
from onnx-go.
Hi,
Thanks for this. I attached an example model and source code:
example_mul.zip
The graph just squares the input:
Expected output (with input = 2.0): 4.0
Actual output:
bad arity for operation (have 1, want 2)
from onnx-go.
Thanks a lot.
I've created a branch for tracking this issue.
I think the solution would be to play with the self edge
(cf godoc).
I've dumped the content of your onnx file for info.
I will work on it tomorrow evening CEST, but from what I see, the solution would be to add a self edge when two inputs are listed and equal.
The main problem is that we are losing the order of inputs as the self-edge must have a fixed weight within the current implementation.
pb.ModelProto{
IrVersion: 5,
OpsetImport: []*pb.OperatorSetIdProto{
&pb.OperatorSetIdProto{
Domain: "",
Version: 7,
},
},
ProducerName: "tf2onnx",
ProducerVersion: "1.5.3",
Domain: "",
ModelVersion: 0,
DocString: "",
Graph: &pb.GraphProto{
Node: []*pb.NodeProto{
&pb.NodeProto{
Input: []string{
"x:0",
"x:0",
},
Output: []string{
"mul:0",
},
Name: "mul",
OpType: "Mul",
Domain: "",
Attribute: nil,
DocString: "",
},
},
Name: "tf2onnx",
Initializer: nil,
DocString: "converted from ./model_nowind_test/export/",
Input: []*pb.ValueInfoProto{
&pb.ValueInfoProto{
Name: "x:0",
Type: &pb.TypeProto{
Value: &pb.TypeProto_TensorType{
TensorType: &pb.TypeProto_Tensor{
ElemType: 1,
Shape: &pb.TensorShapeProto{
Dim: []*pb.TensorShapeProto_Dimension{
&pb.TensorShapeProto_Dimension{
Value: &pb.TensorShapeProto_Dimension_DimValue{
DimValue: 1,
},
Denotation: "",
},
},
},
},
},
Denotation: "",
},
DocString: "",
},
},
Output: []*pb.ValueInfoProto{
&pb.ValueInfoProto{
Name: "mul:0",
Type: &pb.TypeProto{
Value: &pb.TypeProto_TensorType{
TensorType: &pb.TypeProto_Tensor{
ElemType: 1,
Shape: &pb.TensorShapeProto{
Dim: []*pb.TensorShapeProto_Dimension{
&pb.TensorShapeProto_Dimension{
Value: &pb.TensorShapeProto_Dimension_DimValue{
DimValue: 1,
},
Denotation: "",
},
},
},
},
},
Denotation: "",
},
DocString: "",
},
},
ValueInfo: nil,
},
MetadataProps: nil,
}
from onnx-go.
some update about this issue.
The branch has the tests which is already something. At first, I thought it would be easy to implement the self-link, at least in the main graph (in the Model
structure).
The problem is that the simple graph implementation we use as a receiver for gorgonnx does not handle self links.
onnx-go/backend/x/gorgonnx/graph.go
Lines 17 to 18 in 7c482d5
From the godoc of gonum:
SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added and are set to the nodes of the edge otherwise. It will panic if the IDs of the e.From and e.To are equal.
Therefore using a self-link is more difficult than expected.
(On top of that, walking the graph in gorgonnx
would not be trivial.)
Therefore, it may be safer to think about another implementation to solve this issue.
By now, I am out-of-idea, but I am sure a solution exists. We just need to figure it out.
from onnx-go.
Related Issues (20)
- Cannot model.UnmarshalBinary - says 'No data found' HOT 1
- Can't import onnx model, converted from BigGAN-PyTorch HOT 2
- Implement operator LSTM,Clip for backend Gorgonia HOT 1
- Will this project be maintained further and are contributions still welcomed?
- Implement operator `LinearRegressor` for backend `gorgonia`
- "Asymmetric padding" error
- panic: negative dimension size does not make sense
- ../../go/src/gorgonia.org/tensor/dense_compat.go:442:23: undefined: array.Interface HOT 2
- Updated depens
- poor performance (run model)
- run() function calls newMachine() everytime HOT 1
- Question: unsqueeze: axes in not an []int64 HOT 3
- Support for empty tensors
- Tape machine does not reset properly for some models HOT 2
- Implement operator `PReLU` for backend `Gorgonia`
- Implement operator `Cast` for backend `Gorgonia`
- panic: index out of range HOT 4
- the Error during UnmarshalBinary(b)
- Is Conv1D supported?
- Implement operator `Gather` for backend `YYY`
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 onnx-go.