Update models

This commit is contained in:
2024-10-28 10:19:33 -04:00
parent caf6543af4
commit d263ef3ff8
3 changed files with 31 additions and 27 deletions

View File

@@ -25,8 +25,7 @@ from time import time
image_size = (128, 128)
#model_name='vgg16'
model_weights_file='model_vgg16.h5.keras'
model_weights_file='vggnet16.h5.keras'
train_ds = tensorflow.keras.preprocessing.image_dataset_from_directory(
'C:\\boneyard\\DeepLearning\\data',
@@ -171,7 +170,7 @@ model.compile(loss='binary_crossentropy', optimizer=optimizer,metrics=['accuracy
# The callback to checkpointer saves the model wights. Other callback can be added...like a stopping function
# history=model.fit_generator(dataGen.flow(x_train,y_train,batch_size=batch_size),callbacks=[checkpointer],steps_per_epoch=x_train.shape[0] //
# batch_size,epochs=epochs,verbose=2,validation_data=(x_valid,y_valid))
history=model.fit(train_ds, epochs=epochs, validation_data=val_ds,batch_size=batch_size,verbose=2,callbacks=[earlystopping,tensorboard,checkpointer])
history=model.fit(train_ds, epochs=epochs, validation_data=val_ds,batch_size=batch_size,verbose=2,callbacks=[early_stopping,tensorboard,checkpointer])
# Here is the evaluation part
# score=model.evaluate(x=train_ds,verbose=1)