Lesson 3: trying to do skin lesion segmentation

Dear friends,

I’m trying to apply the segmentation notebook to the skin lesion segmentation problem (Skin Lesion Analysis Towards Melanoma Detection - ISIC 2016 challenge - https://challenge.kitware.com/#challenge/560d7856cad3a57cfde481ba), but I’m stuck on two problems:

  1. RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension […]
  2. RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/THCCachingHostAllocator.cpp:265

I’ve been trying to find out a solution but without any progress. When error 1) happens, I change the size of the images and get error 2 (someone said that the problem can be the size - it must be even)

My notebook:

I changed the accuracy to this:

def seg_accuracy(input, target):
target = target.squeeze(1)
return (input.argmax(dim=1)==target).float().mean()

and also tried to use only one transform for data augmentation, but the errors are still with me :frowning:

Anyone knows what is going on?

Thanks in advance!


1 Like

You could run the same in CPU and get the proper error details.

Most of the time , this error is because of the converted mask containing values greater than (Number of classes - 1 ).

Please take a took at

1 Like

Thank you! With the solution from the link you posted, I could run my code. I made a mistake when verifying if the classes were 0 and 1 then I got stuck. Thanks a lot!

1 Like