I recently trained the Mask RCNN (matterport's implementation) on some satellite images, but during inference mode, I'm getting random predictions for the same set of weights for the same image.

That is to say, for a given set of weights and the same image I'm getting different bounding box and mask predictions.

Does anyone have an idea of why this is the case?

The following are the different predictions that the model produced for the same image.

1st run

2nd run

3rd run

On some cases, the model produces reasonable predictions like that of the 2nd image but other times it produces completely random results. I can't figure out where this randomness is coming from.

I would highly appreciate any insight into this problem.

  • $\begingroup$ During the inference, do you really provide the network with those three different images as you provide here, or these are just different zoom-ins you pasted here of the one same image? $\endgroup$ Jan 8 '19 at 7:58
  • $\begingroup$ These are not three different images but one single image. These are the results of inference done on the same image multiple times. $\endgroup$ Jan 8 '19 at 8:14
  • $\begingroup$ Do you have some random process during inference? $\endgroup$ Jan 8 '19 at 9:53
  • $\begingroup$ No, there isn't any. I did notice a strange thing when I run the model on jupyter notebook. If I were to run the same program within a kernel, I get consistent predictions. But if I were to restart the jupyter notebook kernel, the predictions change despite the weights and image being the same. $\endgroup$ Jan 8 '19 at 11:52
  • $\begingroup$ Which framework are you using? $\endgroup$ Jan 8 '19 at 12:05

The problem was that some layers were not getting their weights loaded and were being initialised randomly. The random initialisation of those weights were the cause of random predictions during inference.


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.