dfd27f0374d3a5ea58a3ae0860ee2649150ac2d0,main.py,,get_latest_model,#,183

Before Change


def get_latest_model():
    train_dirs = glob.glob("%s/*_train" % c.TENSORFLOW_OUT_DIR)
    latest_subdir = max(train_dirs, key=os.path.getmtime)
    if not latest_subdir:
        raise RuntimeError("Can not get latest model, no models found in % s" % c.TENSORFLOW_OUT_DIR)
    latest_model = max(glob.glob("%s/model.ckpt-*.meta" % latest_subdir), key=os.path.getmtime)
    if not latest_model:
        raise RuntimeError("Can not get latest model, no models found in %s" % latest_subdir)
    latest_prefix = latest_model[:-len(".meta")]
    return latest_prefix

After Change


    if not latest_model:
        raise RuntimeError("Can not get latest model, no models found in %s" % c.TENSORFLOW_OUT_DIR)
    latest_prefix = latest_model[:-len(".meta")]
    log.info("Latest model is %s", latest_prefix)
    return latest_prefix


log = logs.get_log(__name__)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deepdrive/deepdrive
Commit Name: dfd27f0374d3a5ea58a3ae0860ee2649150ac2d0
Time: 2018-10-12
Author: cquiter@gmail.com
File Name: main.py
Class Name:
Method Name: get_latest_model


Project Name: vatlab/SoS
Commit Name: 5da2d41e1a4c10733ec845cc3bebd08048da2918
Time: 2017-05-03
Author: ben.bog@gmail.com
File Name: sos/jupyter/sos_executor.py
Class Name: Interactive_Executor
Method Name: run


Project Name: deepmipt/DeepPavlov
Commit Name: b1eaa3487165ebaedb489ced63a38eb45f650b5f
Time: 2018-10-17
Author: yoptar@gmail.com
File Name: deeppavlov/models/embedders/glove_embedder.py
Class Name: GloVeEmbedder
Method Name: load