Comments (9)
Torch models still expect input with the batch dimension included. It should be ignored only at the conversion stage to NIR.
from nir.
I see that the input type for the input node is (1, 2, 32, 32)
. So the batch dim is appearing there. I assume this is not supposed to be there?
from nir.
Yeah, the batch dimension shouldn't be there
from nir.
Could the batch dimension be related to the batch dimension in the sample data? On line 40 it's torch.rand((1, 2, 34, 34))
.
from nir.
Is that true? This code works well for me:
import torch
torch.nn.Linear(1, 2)(torch.zeros(1))
from nir.
I get the same error when running infer_type() on an NIRGraph generated by snntorch.export_to_nir() for an input of the following size: [1, 150, 2, 32, 32] including the batch size dimension. Is there a current fix for this?
from nir.
I get the same error when running infer_type() on an NIRGraph generated by snntorch.export_to_nir() for an input of the following size: [1, 150, 2, 32, 32] including the batch size dimension. Is there a current fix for this?
I found a current fix for this --> Adjust (if necessary and only in case of mismatch) dimensions of padding, dilation, and stride in ir._calculate_conv_output() to match the dimension of input_shape
from nir.
To re-open this, do we agree that all NIR graphs should have the batch dimension removed? Or is this something that should go into the newly added metadata field?
We could also add a helper method to add/remove the batch dimension from a NIR graph (should not be too difficult to simply do something like unsqueeze(0)
to all nodes in the graph).
Thoughts? @Jegp @SirineArfa @matjobst (and anyone else)
from nir.
Happy to put that in the spec. Ideally, the graphs should be independent of batches, IMO. Shouldn't batches be independent of the computation? We're not doing any batch norming in NIR, for instance.
from nir.
Related Issues (20)
- Notebook docs run with wrong dependencies
- Comparison of two nodes fails HOT 8
- black and docformatter conflict.
- Discrepancy between Readme and docs on supported projects HOT 4
- Misleading method name `from_list` HOT 8
- Unify version tag and automate release
- IR for SumPool2d
- Poor code design pattern for serializing/deserializing HOT 2
- Disambiguation input/output shapes HOT 5
- Conv2D misleading default input_type and output_type HOT 1
- Remove input_shape from Conv1d/2d
- Flatten input_type is not necessary HOT 2
- Suggestion: add input_type argument to nir.from_list
- meta-data in NIR nodes HOT 3
- LICENSE mismatch HOT 3
- Add AvgPool2D
- Backwards-compatibility of imports broken after refactoring HOT 1
- 'int' object has no attribute 'item' on conv shapes calculation HOT 5
- Remove notebooks and paper data from pypi release 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 nir.