whu-wxy / non-local-u-nets-2d-block Goto Github PK
View Code? Open in Web Editor NEWInplement 2D global aggregation block of Non-local-U-Nets. Written in pytorch.
License: MIT License
Inplement 2D global aggregation block of Non-local-U-Nets. Written in pytorch.
License: MIT License
您好,请问您是在什么环境跑的 是gpu集群还是单gpu,用图片作为输入的时候,显存直接就溢出了
下面是我用于测试的代码,是否存在问题,麻烦指正一下,谢谢
device = torch.device('cuda') # cuda:0
inputs = torch.rand(1, 3, 360, 480).to(device)
net = multi_head_attention_2d(
3, 4, 4, 4, 2, 0.5, 'DOWN').to(device) # 'SAME', 'DOWN', 'UP'
res = net(inputs)
print('res shape:', res.shape)
Traceback (most recent call last):
File "multi_head_attention_2d.py", line 129, in <module>
res = net(inputs)
File "D:\ProgramData\Anaconda3\envs\torch_last\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
result = self.forward(*input, **kwargs)
File "multi_head_attention_2d.py", line 94, in forward
A = torch.matmul(q, k.transpose(0, 1))
RuntimeError: CUDA out of memory. Tried to allocate 111.24 GiB (GPU 0; 6.00 GiB total capacity; 7.91 MiB already allocated; 4.32 GiB free; 22.00 MiB reserved in total by PyTorch)
Hi,
请问怎么将multi-head attention添加到unet中呢?有参考代码吗?
Would you please provide this data set? I can't download it on its website? Thank you
谢谢你的分享!请问在
multi_head_attention_2d(torch.nn.Module):
def init(self, in_channel, key_filters, value_filters,
output_filters, num_heads, dropout_prob=0.5, layer_type='SAME'):
中,key_filters, value_filters, num_heads的值如何确定?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.