Hello,
Unfortunately, I also have a problem reaching accuracy. I come close (TA is >95% but VA never come over 70). I understand that it might be an overfitting problem…but I don’t have the knowledge to handle it correctly.
I tried so far:
-Use optimizer Adam (and play with the learning rate)
-Add two additional Convolutional Layers (including pooling)
-Increased slightly the batch size
-Tried to add another Dense layer and changed the number of nodes
Nothing has been successful so far. I am happy for recommendations.
The assignment asks you to use atleast 3 Conv2D layers.
Here’s the note from the markdown: Note that you should use at least 3 convolution layers to achieve the desired performance.
Please see this thread for pointers on tuning your network.
I am not sure if I understand u correctly. But as I pointed out in my first message, I am already tried using 4 and 5 Conv2D layers (>3). I also read the thread in the link…that’s why I used Adam…
Sorry about that. I misunderstood what you meant by 2 additional conv layers.
Did you follow other pointers in the thread I gave you?
If so, please click my name and messge your notebook as an attachment with code for the best performing model.
You’ve made a mistake in def split_data(SOURCE_DIR, TRAINING_DIR, VALIDATION_DIR, SPLIT_SIZE):
The training images are copied to validation directory and validation images are copied to training directory.
As a result, there are fewer training images for the model to learn and more validation images which is likely to provide a smaller value of accuracy since the distribution of validation data is likely to be wider than training data.
This should be clear from the deviation from expected output:
Expected
666.jpg is zero length, so ignoring.
11702.jpg is zero length, so ignoring.
Original cat’s directory has 12500 images
Original dog’s directory has 12500 images
There are 11249 images of cats for training
There are 11249 images of dogs for training
There are 1250 images of cats for validation
There are 1250 images of dogs for validation
Actual:
666.jpg is zero length, so ignoring.
11702.jpg is zero length, so ignoring.
Original cat’s directory has 12500 images
Original dog’s directory has 12500 images
There are 1250 images of cats for training
There are 1250 images of dogs for training
There are 11249 images of cats for validation
There are 11249 images of dogs for validation
Please fix that to obtain the desired performance.
Thanks a lot for your help - indeed, that was the failure. I was able to fix that and complete the assignment.
Have an enjoyable day and thanks again!
Marc