Comments (10)
No, as far as I know. And sorry for the confusion. As I said, our original code depends heavily on stand-alone self-attention and panoptic-deeplab. However, they have not released their code and we are not authorized to release their code, so we cannot release our original code. Instead of waiting for their releases, we re-implement the work here in PyTorch to let the community access most details of our work as soon as possible.
from axial-deeplab.
I tested models on 224х224 torch.rand tensor
from axial-deeplab.
Hello, thanks for testing it. Please note that this is a re-implementation and we haven't tried to match the inference time as the original code.
I think the main mismatch comes from implementation differences, possibly the positional encoding or batch normalization. In addition, I think the runtime won't increase much if you test it on L models -- we only change the width of the model and keep the depth the same, while ResNet doubles the depth.
from axial-deeplab.
@csrhddlam Why don't you share the original TensorFlow implementation but a PyTorch re-implementation instead? I'm a bit confused...
from axial-deeplab.
It would be almost impossible to release the original code in tensorflow (which runs on TPU), because it is Google property, and it depends on some other packages which are also Google property, e.g. stand-alone self-attention and panoptic-deeplab.
from axial-deeplab.
@csrhddlam Hmm... Has Google recently changed their policy? They used to release TensorFlow code for their published papers...
from axial-deeplab.
@csrhddlam I see. Thanks for the reply!
Good work by the way. Congratulations!
from axial-deeplab.
Just investigated the inference time a bit. Here is my trace on a GPU. I tested it with both pytorch 1.1 and 1.6, and found similar results.
You can see that the relative positional embedding is taking way more time than a convolution.
In addition, reshaping, squeezing, and permutating are also taking way more time than bmm, where actual computation happens.
There is much room to optimize the code in this repo. Even the original TF code was optimized for TPU and tested directly on GPU. So we would expect that the inference time could be improved a lot when it is well optimized.
from axial-deeplab.
einsum
seems to have some performance issues, so maybe directly using bmm
could be faster.
from axial-deeplab.
Thanks for the pointer. I wasn't aware of the issue.
einsum
in PyTorch looks less optimized than einsum_v2
in TensorFlow. And I agree that directly using bmm
, together with some smart permute
and view
could be faster in PyTorch.
from axial-deeplab.
Related Issues (20)
- About the class activation map HOT 3
- position-sensitive attention HOT 1
- Seems dist_train.py didn't wrap the model with the synchronize batch norm HOT 2
- Confused about the `transpose` in positional encoding of key HOT 1
- Pretrained weights HOT 3
- Confused about the shape of relative position encoding HOT 4
- how does axial-attention support multi-scale training/testing? HOT 1
- Question about table 9 in paper HOT 3
- What's HERE?? HOT 1
- Training with non-square images HOT 1
- It seems that the code of qkv_transform is missing. HOT 1
- Question about Axial-Res50 HOT 2
- 关于AxialAttention中kernel_size的问题 HOT 1
- Shape of relative position encoding r^q, r^k, r^v HOT 1
- About local constraints HOT 2
- Pretrain_weights HOT 1
- about function parameter “s=0.5” in code
- why batchnormalization after qkv transform?
- Different resolution for inference
- Can it be used in video tasks?
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 axial-deeplab.