Practice Deep Learning Bootcamp - Assignment 2 - Beginners: Recognize an Animal in an Image Challenge | DPhi

Image recognition is a vital component in robotics such as driverless vehicles or domestic robots. Image recognition is also important in image search engines such as Google or Bing image search whereby you use rich image content to query for similar stuff. Like in Google photos where the system uses image recognition to categorize your images into things like cats, dogs, people and so on so that you can quickly search your albums for things like, “give me photos of my cat”, that's awesome.

This is a companion discussion topic for the original entry at

When i extract the train_beg folder in the colab notebook the order of the images changes and becomes unordered.
So how to make them in order with the labels_csv

Hi @talal
One of the way could be to load the images in the same order as given in the csv file i.e. make use of that csv file while loading the images… Other could be you can make use of for loops and lists though this will be a long procedure.

1 Like

The image size is (200,300,3) and there are 1000 images.
I know how to convert them to numpy array but how to keep all these 1000 3d numpy arrays into one training variable

1 Like

Hi @talal
While converting those to a numpy array, assign it to a variable. This will work.

I am having a problem in my training process i.e the accuracy and loss of my model is not changing rather it remains constant.Even if i train it on gray images

Hi @talal
If your model accuracy is not changing at all, it might be better to use a different Optimizer or Loss Function

I am facing the same issue, Can you give an example.

Thanks @gunnika it worked!!


When I copied this code, # cloning the Datasets repository
!git clone

copying the contents of the animal data folder to Google Drive

!cp -r Datasets/animal_data /content/animal_data/

to my Jupyter Notebook, it showed this error

‘git’ is not recognized as an internal or external command,
operable program or batch file.
‘cp’ is not recognized as an internal or external command,
operable program or batch file.

Please help me out with the error.

Please I need help with building the model. I have loaded the dataset using Method 1 from the Help Notebook sent. But i don’t know how to split the data and parse it into the model. The data type is LIST.


Hi @justus
Converting the images to numpy array is also given in the help notebook itself in the last cell. Also, there was a mandatory notebook to go through before attempting the assignment 2 ‘

Try this to load and extract the training dataset:

!unzip /content/

can we solve the Assignment in our own way and perform all the task ?

should we gray scale the images one by one or all at once. I need help for that. I’ve seen help notebooks too but i’m little confused about that

Yes, you do in any way. But you should complete the tasks mentioned in assignment tasks

You can use for loops to grayscale and pre-process the images

How to load images using flow_from_directory ? I have tried a lot, I always end up getting

Found 0 images belonging to 0 classes.

My directory structure in google colab: /data/train_beg

My Code:

train_generator = datagen_train.flow_from_directory('/content/data/train_beg/',

                                                    target_size = (img_size,img_size),

                                                   color_mode = 'grayscale',

                                                   batch_size = batch_size,

                                                   class_mode = 'categorical',

                                                   shuffle = True)

same problem here…

Found 0 images belonging to 0 classes.
I am receiving this error while running the below code
history = model.fit_generator( train_generator , # train_generator
epochs=60,# epochs, verbose=1,
validation_data = validation_generator)

Can someone please guide me on this issue?