5498cb8bd7e7f3bb10ffe7d2c7ce3b0753df71e2,src/train/retrain.py,,get_or_create_bottleneck,#Any#Any#Any#Any#Any#Any#Any#Any#Any#,386

Before Change


                                          bottleneck_dir, category)
    if not os.path.exists(bottleneck_path):
        print("Creating bottleneck at " + bottleneck_path)
        image_path = get_image_path(image_lists, label_name, index, image_dir,
                                    category)
        if not gfile.Exists(image_path):
            tf.logging.fatal("File does not exist %s", image_path)
        image_data = gfile.FastGFile(image_path, "rb").read()
        bottleneck_values = run_bottleneck_on_image(sess, image_data,
                                                    jpeg_data_tensor,
                                                    bottleneck_tensor)
        bottleneck_string = ",".join(str(x) for x in bottleneck_values)
        with open(bottleneck_path, "w") as bottleneck_file:
            bottleneck_file.write(bottleneck_string)

After Change


  except:
    print("Invalid float found, recreating bottleneck")
    did_hit_error = True
  if did_hit_error:
    create_bottleneck_file(bottleneck_path, image_lists, label_name, index, image_dir, category, sess, jpeg_data_tensor, bottleneck_tensor)
    with open(bottleneck_path, "r") as bottleneck_file:
      bottleneck_string = bottleneck_file.read()
    // Allow exceptions to propagate here, since they shouldn"t happen after a fresh creation
    bottleneck_values = [float(x) for x in bottleneck_string.split(",")]
  return bottleneck_values

def cache_bottlenecks(sess, image_lists, image_dir, bottleneck_dir,
                      jpeg_data_tensor, bottleneck_tensor):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: geometalab/OSMDeepOD
Commit Name: 5498cb8bd7e7f3bb10ffe7d2c7ce3b0753df71e2
Time: 2017-03-20
Author: samuel.kurath@gmail.com
File Name: src/train/retrain.py
Class Name:
Method Name: get_or_create_bottleneck


Project Name: markovmodel/PyEMMA
Commit Name: 4ed172063fc1ec493c91b327e4761192dbb227dd
Time: 2017-08-31
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/serialization/jsonpickler_handlers.py
Class Name: NumpyNPZHandler
Method Name: flatten


Project Name: tensorflow/minigo
Commit Name: da35644f07a8c970d4f571c1ecb94bde3065d8de
Time: 2018-12-29
Author: sethtroisi@google.com
File Name: oneoffs/oneoff_utils.py
Class Name:
Method Name: find_and_filter_sgf_files