Skip to content

Commit 12ce730

Browse files
author
User
committed
update
1 parent b2a08f5 commit 12ce730

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

cnn_class2/siamese.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def get_test_accuracy(threshold=0.85):
425425
valid_steps = int(np.ceil(len(test_positives) * 2 / batch_size))
426426

427427
# fit the model
428-
r = model.fit_generator(
428+
r = model.fit(
429429
train_generator(),
430430
steps_per_epoch=train_steps,
431431
epochs=20,

cnn_class2/use_pretrained_weights_resnet.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from keras.layers import Input, Lambda, Dense, Flatten
1010
from keras.models import Model
11-
from keras.applications.resnet50 import ResNet50, preprocess_input
11+
from keras.applications.resnet import ResNet50, preprocess_input
1212
# from keras.applications.inception_v3 import InceptionV3, preprocess_input
1313
from keras.preprocessing import image
1414
from keras.preprocessing.image import ImageDataGenerator
@@ -21,21 +21,21 @@
2121

2222

2323
# re-size all the images to this
24-
IMAGE_SIZE = [224, 224] # feel free to change depending on dataset
24+
IMAGE_SIZE = [100, 100] # feel free to change depending on dataset
2525

2626
# training config:
2727
epochs = 16
2828
batch_size = 32
2929

3030
# https://www.kaggle.com/paultimothymooney/blood-cells
31-
train_path = '../large_files/blood_cell_images/TRAIN'
32-
valid_path = '../large_files/blood_cell_images/TEST'
31+
# train_path = '../large_files/blood_cell_images/TRAIN'
32+
# valid_path = '../large_files/blood_cell_images/TEST'
3333

3434
# https://www.kaggle.com/moltean/fruits
3535
# train_path = '../large_files/fruits-360/Training'
3636
# valid_path = '../large_files/fruits-360/Validation'
37-
# train_path = '../large_files/fruits-360-small/Training'
38-
# valid_path = '../large_files/fruits-360-small/Validation'
37+
train_path = '../large_files/fruits-360-small/Training'
38+
valid_path = '../large_files/fruits-360-small/Validation'
3939

4040
# useful for getting number of files
4141
image_files = glob(train_path + '/*/*.jp*g')
@@ -125,7 +125,7 @@
125125

126126

127127
# fit the model
128-
r = model.fit_generator(
128+
r = model.fit(
129129
train_generator,
130130
validation_data=valid_generator,
131131
epochs=epochs,

cnn_class2/use_pretrained_weights_vgg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123

124124

125125
# fit the model
126-
r = model.fit_generator(
126+
r = model.fit(
127127
train_generator,
128128
validation_data=valid_generator,
129129
epochs=epochs,

recommenders/autorec.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_generator(A, M, A_test, M_test):
102102
)
103103

104104

105-
r = model.fit_generator(
105+
r = model.fit(
106106
generator(A, mask),
107107
validation_data=test_generator(A_copy, mask_copy, A_test_copy, mask_test_copy),
108108
epochs=epochs,

0 commit comments

Comments
 (0)