|
8 | 8 |
|
9 | 9 | from keras.layers import Input, Lambda, Dense, Flatten
|
10 | 10 | from keras.models import Model
|
11 |
| -from keras.applications.resnet50 import ResNet50, preprocess_input |
| 11 | +from keras.applications.resnet import ResNet50, preprocess_input |
12 | 12 | # from keras.applications.inception_v3 import InceptionV3, preprocess_input
|
13 | 13 | from keras.preprocessing import image
|
14 | 14 | from keras.preprocessing.image import ImageDataGenerator
|
|
21 | 21 |
|
22 | 22 |
|
23 | 23 | # 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 |
25 | 25 |
|
26 | 26 | # training config:
|
27 | 27 | epochs = 16
|
28 | 28 | batch_size = 32
|
29 | 29 |
|
30 | 30 | # 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' |
33 | 33 |
|
34 | 34 | # https://www.kaggle.com/moltean/fruits
|
35 | 35 | # train_path = '../large_files/fruits-360/Training'
|
36 | 36 | # 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' |
39 | 39 |
|
40 | 40 | # useful for getting number of files
|
41 | 41 | image_files = glob(train_path + '/*/*.jp*g')
|
|
125 | 125 |
|
126 | 126 |
|
127 | 127 | # fit the model
|
128 |
| -r = model.fit_generator( |
| 128 | +r = model.fit( |
129 | 129 | train_generator,
|
130 | 130 | validation_data=valid_generator,
|
131 | 131 | epochs=epochs,
|
|
0 commit comments