Error in visualizing the predictions



in the To test our model with our own eyes, let’s visualize its predictions part I am always getting prediction is: 0

img_name = rng.choice(test.filename)
filepath = os.path.join(data_dir,'Train','Images','test',img_name)
img = imread(filepath, flatten = True)
test_index = int(img_name.split('.')[0]) - 49000
print ("Prediction is: {}".format(pred[test_index])) 
pylab.imshow(img,cmap = 'gray')

How do i solve it?


Hi @klaptor,

Make sure you are giving the correct path for the image while reading it.


I did check it. The path is correct. Still i am getting prediction is: 0


Hi @klaptor,

The model might not have been trained properly. You can try to increase the number of epochs while training it.