@staticmethod<EOL><INDENT>def load_keras(json_path=None, hdf5_path=None, by_name=False):<DEDENT>
import os<EOL>try:<EOL><INDENT>import tensorflow<EOL><DEDENT>except ImportError:<EOL><INDENT>os.environ['<STR_LIT>'] = "<STR_LIT>"<EOL>try:<EOL><INDENT>from theano import ifelse<EOL><DEDENT>except ImportError:<EOL><INDENT>raise Exception("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>from bigdl.keras.converter import DefinitionLoader, WeightLoader<EOL>if json_path and not hdf5_path:<EOL><INDENT>return DefinitionLoader.from_json_path(json_path)<EOL><DEDENT>elif json_path and hdf5_path:<EOL><INDENT>return WeightLoader.load_weights_from_json_hdf5(json_path, hdf5_path, by_name=by_name)<EOL><DEDENT>elif hdf5_path and not json_path:<EOL><INDENT>kmodel, bmodel = DefinitionLoader.from_hdf5_path(hdf5_path)<EOL>WeightLoader.load_weights_from_kmodel(bmodel, kmodel)<EOL>return bmodel<EOL><DEDENT>
Load a pre-trained Keras model.

:param json_path: The json path containing the keras model definition.
:param hdf5_path: The HDF5 path containing the pre-trained keras model weights with or without the model architecture.
:return: A bigdl model.