I am new to image processing and machine learning in python. I have been trying to execute a model in google colab using inceptionv3 but i am stuck at fitting the model.
# fit the model
# Run the cell. It will take some time to execute
validation_data=test_set
epochs=10
steps_per_epoch=len(training_set)
validation_steps=len(test_set)
r = model.fit(
training_set,
validation_data,
epochs,
steps_per_epoch,
validation_steps
)
the whole code is in my git repository. https://github.com/Aditya757/MyRepository.git
this is my dataset image link below
https://i.stack.imgur.com/jWaJ8.png
CodePudding user response:
You need to write
model.fit(
training_set,
validation_data=validation_data,
epochs=epochs,
steps_per_epoch=steps_per_epoch,
validation_steps=validation_steps
)
If you pass validation_data without the keyword, it will bind to 'y'
EDIT: also, this was already answered. First result on google HERE...
CodePudding user response:
You have to pass feature vector/matrix X
and ground truth y
first. The .fit()
method assumes validation_data
to be your target/ground truth. Better you specify argument and pass its value.
model.fit(X_train, y_train, validation_data= (X_val, y_val), validation_steps=10, epochs=20, steps_per_epoch=len(X_train), callbacks=[checkpoint,early])