3
$\begingroup$

I have a trained model. For single prediction I restore the last checkpoint and pass a single image for prediction but the result is the same for every row. Does anyone have a clue of what might be wrong?

This is the code for prediction:

enter image description here

And this is the output:

enter image description here

$\endgroup$
5
  • $\begingroup$ Why the output of softmax is like this? would you please provide some information about the input and output of your network? $\endgroup$ Jan 29 '18 at 18:21
  • $\begingroup$ The input is a 3 channel image, and the outpu is a numpy array of shape (256,256,2) where 2 is the number of classes that I have $\endgroup$ Jan 29 '18 at 18:28
  • $\begingroup$ what are two 256s? $\endgroup$ Jan 29 '18 at 18:31
  • $\begingroup$ the image dimension. I think I found the problem. I need my input to have shape of (1, 256, 256, 1), thats why I performed image = image[...,0][...,None]/255 but doing so changed all the values to 0 $\endgroup$ Jan 29 '18 at 18:35
  • $\begingroup$ So answer to your question, people will appreciate it :) $\endgroup$ Jan 29 '18 at 18:41
1
$\begingroup$

I think I found the problem. I need my input to have shape of (1, 256, 256, 1), thats why I performed image = image[...,0][...,None]/255 but doing so changed all the values to 0

$\endgroup$
1
  • $\begingroup$ can you elaborate on why you need that input shape? thanks $\endgroup$ Mar 19 '18 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.