Created
October 2, 2018 16:35
-
-
Save benjamintanweihao/12c02b41461d5bf486c017ba11a491c0 to your computer and use it in GitHub Desktop.
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
import tensorflow as tf | |
import os | |
from tensorflow.python.keras import Input, Model | |
from tensorflow.python.keras.models import load_model | |
from darknet import darknet_base | |
from definitions import ROOT_DIR | |
from yolo_layer import YOLOLayer | |
inputs = Input(shape=(None, None, 3)) | |
outputs, config = darknet_base(inputs) | |
model = Model(inputs, outputs) | |
# model.summary() | |
model.save('model/yolo.h5') | |
model = load_model('model/yolo.h5', custom_objects={'YOLOLayer': YOLOLayer}) | |
print({t.name: t for t in model.inputs}) | |
print({t.name: t for t in model.outputs}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment