Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # SETUP MODEL
- CLASSES = 3
- base_model = InceptionV3(weights='imagenet', include_top=False)
- x=base_model.output
- x=GlobalAveragePooling2D()(x)
- preds=Dense(CLASSES,activation='softmax')(x) #final layer with softmax activation
- model=Model(inputs=base_model.input,outputs=preds)
- # transfer learning
- for layer in base_model.layers:
- layer.trainable = False
- model.compile(loss="categorical_crossentropy", optimizer='adam',metrics=["accuracy"])
- # train the network
- print("[INFO] training network...")
- H = model.fit_generator(
- aug.flow(trainX, trainY, batch_size=BS),
- validation_data=(testX, testY),
- steps_per_epoch=len(trainX) // BS,
- epochs=EPOCHS, verbose=1, callbacks=[csv_logger])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement