b7222818e9dd4d33ee933388e73a11ad8d0bf89b,mlflow/keras.py,,load_pyfunc,#Any#,58

Before Change


    :param model_file: Path to Keras model file.
    :return: PyFunc model.
    
    return _KerasModelWrapper(_load_model(model_file))


def load_model(path, run_id=None):
    

After Change


        // We create an use new Graph and Session and store them with the model
        // This way the model is independent on the global state.
        with graph.as_default():
            with sess.as_default():  // pylint:disable=not-context-manager
                K.set_learning_phase(0)
                m = _load_model(model_file)
        return _KerasModelWrapper(m, graph, sess)
    else:
        raise Exception("Unsupported backend "%s"" % K._BACKEND)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: mlflow/mlflow
Commit Name: b7222818e9dd4d33ee933388e73a11ad8d0bf89b
Time: 2018-09-06
Author: 33237569+tomasatdatabricks@users.noreply.github.com
File Name: mlflow/keras.py
Class Name:
Method Name: load_pyfunc


Project Name: deepchem/deepchem
Commit Name: c96af58e6ab2f85626e51a331e8479da49329f0e
Time: 2017-01-18
Author: joegomes@stanford.edu
File Name: deepchem/models/tensorflow_models/__init__.py
Class Name: TensorflowClassifier
Method Name: predict_proba_on_batch


Project Name: cmu-db/ottertune
Commit Name: c76c8e7bfb2ade8fc5496b60339d77424dfa29b8
Time: 2019-12-17
Author: bohanzhang95@gmail.com
File Name: server/analysis/nn_tf.py
Class Name: NeuralNet
Method Name: get_weights_bin