# Path: minos/model/parameters.py
# def get_custom_layers():
#     return dict(custom_layers)
# 
# def get_custom_activations():
#     return dict(custom_activations)
# 
# Path: minos/tf_utils.py
# def setup_tf_session(device):
#     import tensorflow as tf
#     config = tf.ConfigProto()
#     if hasattr(config, 'gpu_options'):
#         config.allow_soft_placement = True
#         config.gpu_options.allow_growth = True
#     if is_gpu_device(device):
#         config.gpu_options.visible_device_list = str(
#             get_device_idx(device))
#     elif is_cpu_device(device):
#         config.gpu_options.visible_device_list = ''
#     from keras import backend
#     session = tf.Session(config=config)
#     session.run(tf.global_variables_initializer())
#     backend.set_session(session)


from logging.config import dictConfigClass
from os.path import isfile
from posix import remove
from keras.models import load_model
from minos.model.parameters import get_custom_layers, get_custom_activations
from minos.tf_utils import setup_tf_session
import sys
'''
Created on Feb 12, 2017

@author: julien
'''




def disable_sysout():
    sys.stdout.write = lambda s: s


def load_keras_model(filename, device=None):

# Path: minos/model/parameters.py
# def get_custom_layers():
#     return dict(custom_layers)
# 
# def get_custom_activations():
#     return dict(custom_activations)
# 
# Path: minos/tf_utils.py
# def setup_tf_session(device):
#     import tensorflow as tf
#     config = tf.ConfigProto()
#     if hasattr(config, 'gpu_options'):
#         config.allow_soft_placement = True
#         config.gpu_options.allow_growth = True
#     if is_gpu_device(device):
#         config.gpu_options.visible_device_list = str(
#             get_device_idx(device))
#     elif is_cpu_device(device):
#         config.gpu_options.visible_device_list = ''
#     from keras import backend
#     session = tf.Session(config=config)
#     session.run(tf.global_variables_initializer())
#     backend.set_session(session)


# Path: minos/utils.py
from logging.config import dictConfigClass
from os.path import isfile
from posix import remove
from keras.models import load_model
from minos.model.parameters import get_custom_layers, get_custom_activations
from minos.tf_utils import setup_tf_session
import sys

'''
Created on Feb 12, 2017

@author: julien
'''




def disable_sysout():
    sys.stdout.write = lambda s: s


def load_keras_model(filename, device=None):

    setup_tf_session(device)