CCNet-Pure-Pytorch
CCNet-Pure-Pytorch copied to clipboard
Criss-Cross Attention (2d&3d) for Semantic Segmentation in pure Pytorch with a faster and more precise implementation.
您好,感谢您的代码! 大致浏览了下,没有发现CCL的代码,可以指出其位置所在吗? 感谢!
I saw there are 21 classes including a background in the pyt_utils. why did you use num classes=19? any specific reason?
您好,我打算将您写的pytorch版本的RCCA模块应用到视频的不同帧之间,以获得帧与帧之间的注意力进而增强视频帧的特征表示。主要问题是loss没有完全收敛,维持在1-2中间。我想排除一下是不是我网络改的有问题,需要您的帮助!!! 主要任务是视频的显著性检测,取同一视频中任意两帧经过同一ResNet-101,获得 B x 256 x 47 x 47的特征,然后再输入到RCCA模块,先得到 Q_X , K_X , V_X , Q_Y, K_Y, V_Y,即得到两帧映射到Q,K,V空间的特征。然后再用 Q_X 和 K_Y 做相关性矩阵,作用到V_Y,然后是Q_Y 和 K_X 做相关性,作用到 V_X。 代码的实现如下,几乎没怎么改动,希望您能帮我看一眼,感谢! `class RCCAModule(nn.Module): def...
pred = prob[label, np.arange(len(label), dtype=np.int32)] What does this line do in OhemCrossEntropy do?
In the ccnet code. At the end of resnet there is out which gives an output of 33X33 sized image. But it is then passed into the self.criterion(outs, labels). But...
File "/home/zhangli/anaconda3/envs/py36/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1538, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'rcca'
hello i met this problem and please u to see . 1 x = torch.randn(2,64,5,6) 2 ----> 3 y = model(x) 1 frames /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs) 475 result...
`class CC_module(nn.Module): def __init__(self,in_dim): super(CC_module, self).__init__() self.query_conv = nn.Conv2d(in_channels=in_dim, out_channels=in_dim//8, kernel_size=1) self.key_conv = nn.Conv2d(in_channels=in_dim, out_channels=in_dim//8, kernel_size=1) self.value_conv = nn.Conv2d(in_channels=in_dim, out_channels=in_dim, kernel_size=1) self.softmax = Softmax(dim=3) self.INF = INF self.gamma = nn.Parameter(torch.zeros(1))...
在原始代码的评估.py代码中此处: confusion_matrix = torch.from_numpy(confusion_matrix).contiguous().cuda() confusion_matrix = engine.all_reduce_tensor(confusion_matrix, norm=False).cpu().numpy() pos = confusion_matrix.sum(1) res = confusion_matrix.sum(0) tp = np.diag(confusion_matrix) 而你的: #confusion_matrix = torch.from_numpy(confusion_matrix).contiguous().cuda() #confusion_matrix = engine.all_reduce_tensor(confusion_matrix, norm=False).cpu().numpy() 被注释掉了,能不能解释一下啊
Who got this error? I googled and got some reasons about core and GPU version。 But i dont konw how to solve?