Inconsistent tensor sizes at the last layer of SegNet

Could you explain what label_np is? Are these the logits from your model or is it the target?

hi @ptrblck

this is the target which I am converting to numpy array . Sorry for the bad naming convention :frowning_face:

It’s fine. I was just wondering, why you have float values in your target, but it’s because you are interpolating, right?

Running your code produces a color image on my machine. Maybe your preprocessing has a minor bug?
This is the code I’m running:

label_np = np.random.randn(1, 3, 24, 24)

label_np[label_np<0]=0
label_np[label_np>3]=2

label_np[np.logical_and(label_np>0.6,label_np<=3)]=1
label_np[np.logical_and(label_np>0,label_np<=0.6)]=0

color1 = color_transform(torch.from_numpy(label_np))
temp_image1 = image_transform(color1)
temp_image1.save("temp_image_00001.png")

hi ,

yes … Float value is coming for interpolation.