Comments (4)
GPU Mem的话跑程序的时候记录一下GPU Mem花费的最大值就行。
Flops 我用的是thop (pip install thop), 使用方式十分简单,几行代码自定义一个输出测一下就行,具体的代码我没有留存了。
from asformer.
我也用的thop进行测试, 我输入的是一个feature特征,但是报错总说TypeError: forward() missing 1 required positional argument: 'mask',所以我不太清楚哪里有问题。
input = torch.tensor([1,64,4244])
flops,params = profile(self.model, (input,))
print(flops)
print(params)
from asformer.
模型的输入还需要一个mask参数,而且你input生成的方法也有问题, 你可以这样:
input, mask = torch.randn(1, 2048, 4244), torch.ones(1,4244) # 生成一个长度为4244的输入
flops, params = profile(self.model, (input,mask,))
print(flops)
print(params)
from asformer.
谢谢您的帮助,mask问题解决了,但是按照您的代码运行后还是会有一点小问题:IndexError: too many indices for tensor of dimension 2
from asformer.
Related Issues (17)
- cross-self attention HOT 1
- about the randomness of code HOT 1
- Error in evaluation code HOT 2
- Feature Extraction HOT 3
- Enviroment issues HOT 1
- The provided models generate lower scores than the paper reported HOT 3
- How to understand stage images from result HOT 6
- How to extract attention weights HOT 4
- Issue while trying to run the pretained models.
- attention实现的问题 HOT 5
- Long training time HOT 2
- Batch size constraint HOT 6
- Cannot download the model HOT 2
- pre-extracted feature HOT 1
- results on salads50 does not match table 5 HOT 3
- Increase the batchsize and the result is hurt HOT 2
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 asformer.