LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.68k stars 595 forks source link

Attention-Unet : IndexError: tuple index out of range #21

Closed bigmb closed 5 years ago

bigmb commented 5 years ago

Hey Lee, So I am wanted to implement Attention Unet. But there is some issue coming up while using it. I am using my own dataset and also doing a lot of preprocessing with data. When I am using your model I get this error.

error

Any idea about it? Its for medical binary segmentation

LeeJunHyun commented 5 years ago

Hi, @bigmb . Can you try torch.summary.summary(model_test1, input_size=(3,256,256))? or torch.summary.summary(model_test1, input_size=(256,256,3))?

bigmb commented 5 years ago

Hello, Tried both. So for the input size = 3,256,256 Got the same erorr.

Second gives an error as it expects 3 channel as the first input.

LeeJunHyun commented 5 years ago

Can you try this with ISIC data?

It seems that I need to check the mid status of x ~ x4

bigmb commented 5 years ago

Hey, So I am not passing any images. This just create a random variable of size (3,128,128). It should just make a summary of the model. But still let me check with that dataset

LeeJunHyun commented 5 years ago

Yes, I also know that library, torchsummary.

I can't notice why it is not working for test Tensor.

plz check the inference with real data.

bigmb commented 5 years ago

So I Checked with my own MRI data, Still the same issue. I will try ISIC dataset in the weekend and let you know.

bigmb commented 5 years ago

I checked, so the issue is with torchsummary only , works after updating to pytorch 1.1.0. Program runs when I run your original model too. So Closing the issue. It's related to TorchSummary , so don't run it.