Discussion for quizzes in article: Hands on with Deep Learning – Solution for Age Detection Practice Problem



You can use this thread to post your answers for exercises asked in the article


Hi @jalFaizy,

Can you please post solution with highest accuracy so that we all could learn from it.

I tried many architectures but was not able to get as much accuracy.



here we have used the Stochastic gradient descent optimizer (i.e optimizer =‘sgd’). did any one tried using (optimizer =‘adam’) i believe Adam is also a Stochastic Optimization algorithm. I have seen people using ‘adam’ algorithm which is yielding better results

# Python 3 code to randomly load an image into jupyter notebook and print it and open it

import os, random



from PIL import Image
file = image_folder+'\\'+a


This is the simplest way I can use matplotlib to solve the problem:

import matplotlib.pyplot as plt
from random import randint
img_name = randint(0, 26542)
img = plt.imread("C:\\Users\\User\\Age Detection\\Dataset\\Train\\Train\\" + str(img_name) + ".JPG")