Comments (7)
Thank you.
Can you let me know where you are facing this issue? ( in model or preprocessing )
from unet-segmentation-pytorch-nest-of-unets.
Thanks a lot! It is in model , when the label color is (0,255), and the out_ch=3
File "pytorch_run.py", line 302, in <module>
s_label = data_transform(im_label)
File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 67, in __call__
img = t(img)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 226, in forward
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py", line 284, in normalize
tensor.sub_(mean).div_(std)
RuntimeError: output with shape [1, 96, 96] doesn't match the broadcast shape [3, 96, 96]
from unet-segmentation-pytorch-nest-of-unets.
Can you look at this issue?
#37
Also, change the out_ch=1 (that's the output channel you will be getting as an output.)
from unet-segmentation-pytorch-nest-of-unets.
So appreciated for your guidance, but the case a little different. Now I have the following set:
torchvision.transforms.Normalize((0.5,), (0.5,))
im_tb = Image.open(test_image).convert('RGB')
def __init__(self, in_ch=3, out_ch=1):
But it still get this :
File "pytorch_run.py", line 265, in <module> lossT = calc_loss(y_pred, y) # Dice_loss Used File "/content/Unet-Segmentation-Nest-of-Unets/losses.py", line 32, in calc_loss bce = F.binary_cross_entropy_with_logits(prediction, target) File "/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py", line 2580, in binary_cross_entropy_with_logits raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size())) ValueError: Target size (torch.Size([4, 2, 96, 96])) must be the same as input size (torch.Size([4, 1, 96, 96]))
How can I make both of them work?
With regards
from unet-segmentation-pytorch-nest-of-unets.
Currently, I am seeing only one issue that you are facing with the loss function.
Can you check the size of the input to the y_pred and y
?
I think the shape of the data is getting mismatched somewhere due to preproccesing.
from unet-segmentation-pytorch-nest-of-unets.
Thanks a lot, that problem solved, but why got this with 3 channels input?
[Errno 99] Cannot assign requested address Given groups=1, weight of size [64, 3, 3, 3], expected input[3, 1, 128, 128] to have 3 channels, but got 1 channels instead Error occurs, No graph saved Traceback (most recent call last): File "pytorch_run.py", line 176, in <module> writer1.add_graph(model_test, model_test(torch.randn(3, 3, 128, 128, requires_grad=True)))
and seems that the tensorboardX can not work well?
With regards,
from unet-segmentation-pytorch-nest-of-unets.
If you are planing to use tensorboardx it's going to be difficult.
Currently tensorboardx doesnt support skip connections. If it's a simple network it works.
I havnt checked if the current version is upgraded for the same. I will have a look at that next weekend.
Is the main code working for you?
from unet-segmentation-pytorch-nest-of-unets.
Related Issues (20)
- hello,is label a 3 channels image? HOT 4
- May have future issues in input size in basic Unet HOT 1
- Data transformation HOT 4
- loss HOT 1
- dim HOT 1
- Caught RuntimeError in DataLoader worker process 0& The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0 HOT 11
- Help for data or data format HOT 1
- Data set HOT 4
- train my data
- IndexError: tuple index out of range HOT 2
- effect
- Aboot DataBase HOT 1
- choose network HOT 5
- RuntimeError: output with shape [1, 800, 600] doesn't match the broadcast shape [3, 800, 600] HOT 5
- How to get my output? HOT 1
- Regarding Dataset HOT 1
- r2unet HOT 3
- RuntimeError: DataLoader worker (pid(s) 38348, 20180, 30224, 8512, 38232, 19588, 39276, 10048) exited unexpectedly HOT 1
- Data Set HOT 2
- RuntimeError: output with shape [1, 767, 1022] doesn't match the broadcast shape [3, 767, 1022] HOT 1
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 unet-segmentation-pytorch-nest-of-unets.