I have this tensorflow model that I’d like to convert to pytorch. I tried reading the documentation but it’s still a little fuzzy. Could someone help me?
upsampled = tf.image.resize_images(white_lr, tf.shape(label)[1:3])
C0 = 25
D = 5
h = tf.concat([one_hot_label, upsampled], axis=-1)
hs = []
for i in range(D):
hs.append(h)
h = tf.contrib.layers.conv2d(h, int(C0*1.5**i), (3,3), stride=2, scope='conv%d'%(i+1))
h = tf.concat([h, tf.image.resize_images(white_lr, tf.shape(h)[1:3])], axis=-1)
for i in range(D)[::-1]:
h = tf.contrib.layers.conv2d_transpose(h, int(C0*1.5**i), (3,3), stride=2, scope='upconv%d'%(i+1))
h = tf.concat([h, hs[i]], axis=-1)
h = tf.contrib.layers.conv2d(h, C0, (1,1), scope='fc1')
h = tf.contrib.layers.conv2d(h, 3, (1,1), scope='cls', activation_fn=None)
h = h + upsampled