Ken Geonmin Kim
Ken Geonmin Kim

Reputation: 37

Tensorflow session.run() does not proceed

I am running https://github.com/lordet01/segan/blob/master/train_segan.sh in my machine. The code does not proceed at line below (in model.py) :

sample_noisy, sample_wav, sample_z = self.sess.run([self.gtruth_noisy[0], self.gtruth_wavs[0], self.zs[0]]) 

As a tensorflow beginner, this line seems just converting nodes to tensors.

Could you suggest any possible reason why it does not proceed from line above? I really appreciate any comments :)

My computing environment is as follows : Python 3.6.0 (installed by Anaconda), TensorFlow 1.2.1, Cuda 8.0, TitanX(x2)

Upvotes: 1

Views: 927

Answers (1)

ASHu2
ASHu2

Reputation: 2047

As the question is old, and the repository is not up-to-date with the original master branch, the optimisation of the network is not working.

Some of the changes that were introduced that are important are here.

So basically the reason why your model never converges(or atleast takes a long time), because of all the gradients are stored as lists.

New additions that are relevant to your question are :

def build_model(self, config):
        all_d_grads = []
        all_g_grads = []
        d_opt = tf.train.RMSPropOptimizer(config.d_learning_rate) #these lines are new
        g_opt = tf.train.RMSPropOptimizer(config.g_learning_rate) #these lines are new

NEW:

# deemphasize
c_res = de_emph(c_res, self.preemph)

#segan/data_loader method
def de_emph(y, coeff=0.95):
    if coeff <= 0:
        return y
    x = np.zeros(y.shape[0], dtype=np.float32)
    x[0] = y[0]
    for n in range(1, y.shape[0], 1):
        x[n] = coeff * x[n - 1] + y[n]
    return x

OLD:

#There is no deemphasize, having which saves a considerable amount of time.

And minor changes like the whole conversion to a class with all values retained as object..etc.

Upvotes: 1

Related Questions