This file contains hidden or 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
################################################### | |
# settings.py/the file where to load the models | |
################################################### | |
def load_model_from_path(path): | |
graph = tf.get_default_graph() | |
model = load_model(path) | |
return graph, model | |
def load_all_models(): | |
global gModelObjs # each object is a tuple of graph, model |
This file contains hidden or 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_from_path(path): | |
global gGraph | |
global gModel | |
gGraph = tf.get_default_graph() | |
gModel = load_model(path) # keras function | |
_load_model_from_path('path_to_model') |
This file contains hidden or 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 json | |
import os | |
import numpy as np | |
import pandas as pd | |
import tensorflow as tf | |
from keras import backend as K | |
from keras.models import load_model | |
from rest_framework.decorators import api_view |
NewerOlder