From 2b2ece6651d3e6285e4c628e995203abf5af9345 Mon Sep 17 00:00:00 2001 From: Souham Ghosh <30503357+Sgsouham@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:16:33 +0530 Subject: [PATCH 1/2] Update eidetic_3d_lstm_net.py From e6caa2012cfd24ba88641f2489d521bcca2dc1bb Mon Sep 17 00:00:00 2001 From: Souham Ghosh <30503357+Sgsouham@users.noreply.github.com> Date: Sun, 7 Jun 2020 21:07:26 +0530 Subject: [PATCH 2/2] Update eidetic_3d_lstm_net.py --- src/models/eidetic_3d_lstm_net.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/eidetic_3d_lstm_net.py b/src/models/eidetic_3d_lstm_net.py index de345f4..6640aa5 100644 --- a/src/models/eidetic_3d_lstm_net.py +++ b/src/models/eidetic_3d_lstm_net.py @@ -57,7 +57,7 @@ def rnn(images, real_input_flag, num_layers, num_hidden, configs): memory = zero_state - with tf.variable_scope('generator'): + with tf.compat.v1.variable_scope('generator'): input_list = [] reuse = False for time_step in range(window_length - 1): @@ -65,7 +65,7 @@ def rnn(images, real_input_flag, num_layers, num_hidden, configs): tf.zeros([batch_size, ims_width, ims_height, output_channels])) for time_step in range(total_length - 1): - with tf.variable_scope('e3d-lstm', reuse=reuse): + with tf.compat.v1.variable_scope('e3d-lstm', reuse=reuse): if time_step < input_length: input_frm = images[:, time_step] else: @@ -76,7 +76,7 @@ def rnn(images, real_input_flag, num_layers, num_hidden, configs): if time_step % (window_length - window_stride) == 0: input_frm = tf.stack(input_list[time_step:]) - input_frm = tf.transpose(input_frm, [1, 0, 2, 3, 4]) + input_frm = tf.transpose(a=input_frm, perm=[1, 0, 2, 3, 4]) for i in range(num_layers): if time_step == 0: @@ -90,7 +90,7 @@ def rnn(images, real_input_flag, num_layers, num_hidden, configs): hidden[i], cell[i], memory = lstm_layer[i]( inputs, hidden[i], cell[i], memory, c_history[i]) - x_gen = tf.layers.conv3d(hidden[num_layers - 1], output_channels, + x_gen = tf.compat.v1.layers.conv3d(hidden[num_layers - 1], output_channels, [window_length, 1, 1], [window_length, 1, 1], 'same') x_gen = tf.squeeze(x_gen) @@ -98,9 +98,9 @@ def rnn(images, real_input_flag, num_layers, num_hidden, configs): reuse = True gen_images = tf.stack(gen_images) - gen_images = tf.transpose(gen_images, [1, 0, 2, 3, 4]) + gen_images = tf.transpose(a=gen_images, perm=[1, 0, 2, 3, 4]) loss = tf.nn.l2_loss(gen_images - images[:, 1:]) - loss += tf.reduce_sum(tf.abs(gen_images - images[:, 1:])) + loss += tf.reduce_sum(input_tensor=tf.abs(gen_images - images[:, 1:])) out_len = total_length - input_length out_ims = gen_images[:, -out_len:]