Skip to content

Commit

Permalink
Changed load_model import to match the requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Skar0 committed Nov 18, 2019
1 parent 67cc4ca commit 0e1b5fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion evaluate_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import cv2
import numpy as np
from keras.engine.saving import load_model
from keras.models import load_model
from keras.preprocessing import image
from matplotlib import pyplot as plt

Expand Down
2 changes: 1 addition & 1 deletion launcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
import numpy as np
from keras.engine.saving import load_model
from keras.models import load_model
from keras.preprocessing import image
from evaluate_model import evaluate_model, extract_hard_samples
from transfer_learning import train_simpler_inception_based_model
Expand Down
7 changes: 5 additions & 2 deletions transfer_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import math
import numpy as np
from keras.engine.saving import load_model
from keras.models import load_model
from keras.optimizers import SGD
from keras.preprocessing import image
from matplotlib import pyplot as plt
Expand Down Expand Up @@ -354,6 +354,7 @@ def create_simpler_inception_based_model():

def train_simpler_inception_based_model(dataset_path,
fine_tune_existing=None,
save_path="best_trained_save.h5",
freeze=True,
learning_rate=0.001,
percentage=0.9,
Expand Down Expand Up @@ -395,7 +396,9 @@ def train_simpler_inception_based_model(dataset_path,
if not os.path.exists(simpler_inception_based_model_save_folder):
os.makedirs(simpler_inception_based_model_save_folder)

simpler_inception_based_model_save_path = simpler_inception_based_model_save_folder + "best_trained_save.h5"
simpler_inception_based_model_save_path = simpler_inception_based_model_save_folder + save_path

simpler_inception_based_model.summary()

# We can do learning rate adaptation later as part of fine tuning or use adaptive optimizer (rmsprop, adam)
# keras.callbacks.callbacks.LearningRateScheduler(schedule, verbose=0)
Expand Down
2 changes: 1 addition & 1 deletion video_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import cv2
import imageio
import numpy as np
from keras.engine.saving import load_model
from keras.models import load_model
from keras.preprocessing import image

"""
Expand Down

0 comments on commit 0e1b5fa

Please sign in to comment.