hilab-git / ca-net Goto Github PK
View Code? Open in Web Editor NEWCode for Comprehensive Attention Convolutional Neural Networks for Explainable Medical Image Segmentation.
Code for Comprehensive Attention Convolutional Neural Networks for Explainable Medical Image Segmentation.
运行validation.py时,发生报错RuntimeError: The first supplied array does not contain any binary object,该怎么解决呢,谢谢!
In your code, drop_out=True
CA-Net/Models/networks/network.py
Line 55 in 94f2624
CA-Net/Models/networks/network.py
Line 36 in 94f2624
CA-Net/Models/networks/network.py
Line 39 in 94f2624
CA-Net/Models/layers/channel_attention_layer.py
Lines 95 to 96 in 94f2624
I think this line of code will affect the results when testing. Because you init the dropout layer in forward
function, the model.eval()
can not change the status of this layer.
You can test it with the following code
import torch
from torch import nn
import numpy as np
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.out = nn.Dropout2d(0.5)
def forward(self, x):
out = nn.Dropout2d(0.5)(x)
# out = self.out(x)
return out
if __name__ == '__main__':
model = Net()
model.eval()
input_npy = np.array([[1.0, 2.0], [3.0, 4.0]])
input_tensor = torch.from_numpy(input_npy)
output = model(input_tensor)
print(output)
If I didn't understand your code correctly, sorry in advance
Should the bilinear interpolation(Image.BILINEAR) of label scaling be changed to nearest neighbor interpolation(Image.NEAREST)?
Line 163 in 94f2624
Hello, may I ask how to save the attention weight map in the middle step of the network. Thank you very much.
Should i train all 5 folders and compute average?
Traceback (most recent call last):
File "main.py", line 470, in
main(args)
File "main.py", line 305, in main
model = Test_Model[args.id](args, args.num_input, args.num_classes)
File "/home/SA/ljc/ca/CA-Net-master/Models/networks/network.py", line 28, in init
self.conv1 = conv_block(self.in_channels, filters[0])
File "/home/SA/ljc/ca/CA-Net-master/Models/layers/modules.py", line 21, in init
nn.Conv2d(ch_in, ch_out, kernel_size=3, stride=1, padding=1, bias=True),
File "/home/SA/anaconda3/envs/ljctorchpy3.6/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 332, in init
False, _pair(0), groups, bias, padding_mode)
File "/home/SA/anaconda3/envs/ljctorchpy3.6/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 22, in init
if in_channels % groups != 0:
TypeError: unsupported operand type(s) for %: 'Namespace' and 'int'
i have tried a lot versions pytorch,1.4.0/1.7.0/1.10.0, but don't work
do you konw how to fix it, thx!
Why does setting different batch_size affect the test results?
Dear author:
如何得到表1的结果呢,想学习一下
In the paper, it's written that the images are randomly divided into three subsets for training, validating and testing, respectively.
While in this repo, authors perform 5-folds cross-validation.
So, which one is the true setting presented in the paper?
Hi,
Thanks for sharing your code. Can I find your fetus model available online?
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.