Python Forum
Increasing validation accuracy on a CNN
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Increasing validation accuracy on a CNN
#1
Hello,

I followed this tutorial: https://keras.io/examples/vision/image_c...m_scratch/
and I have built a CNN. After many tires I managed to make validation accuracy: 0.6907. But it does not increase and it does change:
Epoch 1/10
37/37 [==============================] - 511s 14s/step - loss: 0.7337 - accuracy: 0.4516 - val_loss: 0.6922 - val_accuracy: 0.6907
Epoch 2/10
37/37 [==============================] - 532s 14s/step - loss: 0.6004 - accuracy: 0.7044 - val_loss: 0.6877 - val_accuracy: 0.6907
Epoch 3/10
37/37 [==============================] - 541s 15s/step - loss: 0.4859 - accuracy: 0.8132 - val_loss: 0.6810 - val_accuracy: 0.6907
Epoch 4/10
37/37 [==============================] - 552s 15s/step - loss: 0.4076 - accuracy: 0.8483 - val_loss: 0.6729 - val_accuracy: 0.6907
Epoch 5/10
37/37 [==============================] - 513s 14s/step - loss: 0.3684 - accuracy: 0.8518 - val_loss: 0.6650 - val_accuracy: 0.6907
Epoch 6/10
37/37 [==============================] - 504s 14s/step - loss: 0.3375 - accuracy: 0.8638 - val_loss: 0.6574 - val_accuracy: 0.6907
Epoch 7/10
37/37 [==============================] - 463s 13s/step - loss: 0.3176 - accuracy: 0.8783 - val_loss: 0.6525 - val_accuracy: 0.6907
Epoch 8/10
37/37 [==============================] - 524s 14s/step - loss: 0.2883 - accuracy: 0.8937 - val_loss: 0.6490 - val_accuracy: 0.6907
Epoch 9/10
37/37 [==============================] - 524s 14s/step - loss: 0.2658 - accuracy: 0.9015 - val_loss: 0.6461 - val_accuracy: 0.6907
Epoch 10/10
37/37 [==============================] - 524s 14s/step - loss: 0.2576 - accuracy: 0.9049 - val_loss: 0.6429 - val_accuracy: 0.6907
How can I fix that? I have read tutorials and implemented changes but without any improvement...
Reply
#2
I ran the same code and am not able to increase the val accuracy too. I recently did a similar kind of project. Try this out,I was able to gain 80% accuracy (validation)when trained from scratch. After that, I used a pre-trained model Xception to get better results. Here is a link to the article. I have classified 10 animals using a dataset from Kaggle.Recognizing HD images of animals with CNN from scratch
Reply
#3
@hussainmujtaba: I am trying the code from the tutorial you have posted, but I got this error:

2020-06-20 12:17:24.726191: W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated.
	 [[{{node PyFunc}}]]
Did you face something similar? If yes, how did you handle it?
Reply
#4
Someone who can help, how to solve this error? Thanx...
Reply
#5
Try running on Colab. I was usin tf 2.0 , can you make sure that you are also using same
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  LSTM Model accuracy caps and I can't improve it celinafregoso99 1 1,950 Dec-19-2020, 01:29 PM
Last Post: jefsummers
  Loss and Accuracy Figures. Hani 3 2,982 May-20-2020, 06:55 PM
Last Post: jefsummers
  Best Accuracy From Loop. AhmadMWaddah 4 2,403 Mar-17-2020, 10:25 PM
Last Post: stullis
  Why is my train and test accuracy so low? python420 0 2,032 Dec-08-2019, 08:51 PM
Last Post: python420
  Low accuracy for fake news detection model shivani 1 2,290 Oct-10-2019, 12:09 PM
Last Post: animeshagrawal2807

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020