diff --git a/one_shot_learning_network.py b/one_shot_learning_network.py index 58140cd24..f9eefed6b 100644 --- a/one_shot_learning_network.py +++ b/one_shot_learning_network.py @@ -109,7 +109,7 @@ def __call__(self, support_set, input_image, name, training=False): eps = 1e-10 similarities = [] for support_image in tf.unstack(support_set, axis=0): - sum_support = tf.reduce_sum(tf.square(support_image), 1, keep_dims=True) + sum_support = tf.reduce_sum(tf.square(support_image), 1, keepdims=True) support_magnitude = tf.rsqrt(tf.clip_by_value(sum_support, eps, float("inf"))) dot_product = tf.matmul(tf.expand_dims(input_image, 1), tf.expand_dims(support_image, 2)) dot_product = tf.squeeze(dot_product, [1, ]) diff --git a/train_one_shot_learning_matching_network.py b/train_one_shot_learning_matching_network.py old mode 100644 new mode 100755 index e13335b27..ef2ae0493 --- a/train_one_shot_learning_matching_network.py +++ b/train_one_shot_learning_matching_network.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from one_shot_learning_network import * from experiment_builder import ExperimentBuilder import tensorflow.contrib.slim as slim