Last active
April 11, 2020 07:34
-
-
Save quangnhat185/443a3f3b713064c1d7a28e6bae01475d to your computer and use it in GitHub Desktop.
Load pre-trained model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_model(path): | |
try: | |
path = splitext(path)[0] | |
with open('%s.json' % path, 'r') as json_file: | |
model_json = json_file.read() | |
model = model_from_json(model_json, custom_objects={}) | |
model.load_weights('%s.h5' % path) | |
print("Loading model successfully...") | |
return model | |
except Exception as e: | |
print(e) | |
wpod_net_path = "wpod-net.json" | |
wpod_net = load_model(wpod_net_path) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment