import tensorflow as tf


        self.encoder_1 = self.conv2
        self.encoder_2 = self.conv3
        self.encoder_3 = self.conv4
        self.encoder_4 = self.conv5
        print("\nEncoder RESNET is built successfully\n\n")

    @timeit
    def load_pretrained_weights(self, sess):
        print("Loading pretrained weights of resnet18")
        all_vars = tf.trainable_variables()
        all_vars += tf.get_collection('mu_sigma_bn')
        for v in all_vars:
            if v.op.name in self.pretrained_weights.keys():
                assign_op = v.assign(self.pretrained_weights[v.op.name])
                sess.run(assign_op)
                print(v.op.name + " - loaded successfully")
        print("All pretrained weights of resnet18 is loaded")

    def _residual_block(self, name, x, filters, pool_first=False, strides=1, dilation=1):
