Commit 654b484d authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV

tensorflow algo suports new model format

parent b7475dee
Pipeline #5809 failed with stages
in 12 minutes and 47 seconds
......@@ -32,11 +32,11 @@ class TensorflowAlgo(Algorithm):
)
self.data_reader = DiskAudio([0], [0])
self.session = tf.Session()
# self.session = tf.Session()
self.dnn_model = None
def __del__(self):
self.session.close()
# def __del__(self):
# self.session.close()
def _check_feature(self, feature):
"""Checks that the features are appropriate."""
......@@ -47,7 +47,8 @@ class TensorflowAlgo(Algorithm):
def load_projector(self, projector_file):
logger.info("Loading pretrained model from {0}".format(projector_file))
self.dnn_model = SequenceNetwork()
self.dnn_model.load(bob.io.base.HDF5File(projector_file), session=self.session)
# self.dnn_model.load(bob.io.base.HDF5File(projector_file), session=self.session)
self.dnn_model.load(projector_file, True)
def project_feature(self, feature):
......@@ -56,8 +57,9 @@ class TensorflowAlgo(Algorithm):
frames = numpy.asarray(frames)
logger.debug(" .... And %d frames are extracted to pass into DNN model" % frames.shape[0])
frames = numpy.reshape(frames, (frames.shape[0], -1, 1))
forward_output = self.dnn_model(frames, session=self.session)
return tf.nn.log_softmax(tf.nn.log_softmax(forward_output)).eval(session=self.session)
forward_output = self.dnn_model(frames)
# return tf.nn.log_softmax(tf.nn.log_softmax(forward_output)).eval(session=self.session)
return forward_output
def project(self, feature):
"""project(feature) -> projected
......
......@@ -58,7 +58,7 @@ bob.pad.base = git git@gitlab.idiap.ch:bob/bob.pad.base.git
bob.ap = git git@gitlab.idiap.ch:bob/bob.ap.git
bob.db.voicepa = git git@gitlab.idiap.ch:bob/bob.db.voicepa.git
bob.extension = git git@gitlab.idiap.ch:bob/bob.extension.git
bob.learn.tensorflow = git branch=audio-support git@gitlab.idiap.ch:tiago.pereira/bob.learn.tensorflow.git
bob.learn.tensorflow = git branch=epoch git@gitlab.ch:bob/bob.learn.tensorflow.git
bob.bio.db = git git@gitlab.idiap.ch:bob/bob.bio.db.git
bob.pad.db = git git@gitlab.idiap.ch:bob/bob.pad.db.git
bob.bio.spear = git branch=cpqd git@gitlab.idiap.ch:bob/bob.bio.spear.git
......
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