Fixed bug validation

parent bf2fd38f
......@@ -65,12 +65,12 @@ class ExperimentAnalizer:
# Extracting features for enrollment
enroll_data, enroll_labels = base_data_shuffler.get_batch()
enroll_features = network(enroll_data, session=session)
enroll_features = network(enroll_data)
del enroll_data
# Extracting features for probing
probe_data, probe_labels = base_data_shuffler.get_batch()
probe_features = network(probe_data, session=session)
probe_features = network(probe_data)
del probe_data
# Creating models
......
......@@ -322,8 +322,11 @@ class SequenceNetwork(six.with_metaclass(abc.ABCMeta, object)):
session = Session.instance().session
self.sequence_net = pickle.loads(open(path+"_sequence_net.pickle").read())
saver = tf.train.import_meta_graph(path + ".meta", clear_devices=clear_devices)
#saver = tf.train.import_meta_graph(path + ".meta")
if clear_devices:
saver = tf.train.import_meta_graph(path + ".meta", clear_devices=clear_devices)
else:
saver = tf.train.import_meta_graph(path + ".meta")
saver.restore(session, path)
self.inference_graph = tf.get_collection("inference_graph")[0]
self.inference_placeholder = tf.get_collection("inference_placeholder")[0]
......
......@@ -256,7 +256,7 @@ class SiameseTrainer(Trainer):
"""
if self.validation_summary_writter is None:
self.validation_summary_writter = tf.train.SummaryWriter(os.path.join(self.temp_dir, 'validation'), session.graph)
self.validation_summary_writter = tf.train.SummaryWriter(os.path.join(self.temp_dir, 'validation'), self.session.graph)
self.validation_graph = self.compute_graph(data_shuffler, name="validation", training=False)
feed_dict = self.get_feed_dict(data_shuffler)
......
......@@ -440,7 +440,7 @@ class Trainer(object):
# Running validation
if validation_data_shuffler is not None and step % self.validation_snapshot == 0:
self.compute_validation(self.session, validation_data_shuffler, step)
self.compute_validation(validation_data_shuffler, step)
if self.analizer is not None:
self.validation_summary_writter.add_summary(self.analizer(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment