usuyama / pytorch-unet

Simple PyTorch implementations of U-Net/FullyConvNet (FCN) for image segmentation
https://colab.research.google.com/github/usuyama/pytorch-unet/blob/master/pytorch_unet_resnet18_colab.ipynb
MIT License
827 stars 233 forks source link

Resnet Model Validity #3

Closed ozen closed 5 years ago

ozen commented 5 years ago

Hi,

I can't get your pytorch_resnet18_unet.ipynb working.

In layer4 = self.layer4_1x1(layer4) line, it throws the following error:

RuntimeError: Given groups=1, weight of size [1024, 2048, 1, 1], expected input[2, 512, 7, 7] to have 2048 channels, but got 512 channels instead

I haven't modified any of your code.

usuyama commented 5 years ago

Thanks for reporting. I was testing the model with resnet50 and forgot to go back to resnet18. Updated the notebook https://github.com/usuyama/pytorch-unet/blob/master/pytorch_resnet18_unet.ipynb