From 03a2f5629f4024a3d01d6d5fb87ed6a784e62bd3 Mon Sep 17 00:00:00 2001 From: Vineet Jain Date: Wed, 1 Apr 2020 18:10:46 +0530 Subject: [PATCH 1/2] correcting import as oldone works only for keras<=2.2.4 --- cnn_class2/use_pretrained_weights_vgg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cnn_class2/use_pretrained_weights_vgg.py b/cnn_class2/use_pretrained_weights_vgg.py index 01cbd619..78888a2b 100644 --- a/cnn_class2/use_pretrained_weights_vgg.py +++ b/cnn_class2/use_pretrained_weights_vgg.py @@ -10,7 +10,7 @@ from keras.applications.vgg16 import VGG16 from keras.applications.vgg16 import preprocess_input from keras.preprocessing import image -from keras.preprocessing.image import ImageDataGenerator +from tensorflow.keras.preprocessing.image import ImageDataGenerator from sklearn.metrics import confusion_matrix import numpy as np @@ -179,4 +179,4 @@ def get_confusion_matrix(data_path, N): from util import plot_confusion_matrix plot_confusion_matrix(cm, labels, title='Train confusion matrix') -plot_confusion_matrix(valid_cm, labels, title='Validation confusion matrix') \ No newline at end of file +plot_confusion_matrix(valid_cm, labels, title='Validation confusion matrix') From f1c88f1e5a2df934a325c18007dcfea5d093757d Mon Sep 17 00:00:00 2001 From: Vineet Jain Date: Wed, 1 Apr 2020 19:37:16 +0530 Subject: [PATCH 2/2] correcting dictionary keys --- cnn_class2/use_pretrained_weights_vgg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cnn_class2/use_pretrained_weights_vgg.py b/cnn_class2/use_pretrained_weights_vgg.py index 78888a2b..bcad87e8 100644 --- a/cnn_class2/use_pretrained_weights_vgg.py +++ b/cnn_class2/use_pretrained_weights_vgg.py @@ -172,8 +172,8 @@ def get_confusion_matrix(data_path, N): plt.show() # accuracies -plt.plot(r.history['acc'], label='train acc') -plt.plot(r.history['val_acc'], label='val acc') +plt.plot(r.history['accuracy'], label='train acc') +plt.plot(r.history['val_accuracy'], label='val acc') plt.legend() plt.show() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy