otherwise = K.abs(error) - c
    return tf.where(cond, true, otherwise)


with tf.device('/device:GPU:2'):
    input = Input((192, 192, 3), name='Input')

    conv1 = initial_conv_block1(input)
    conv1 = Residual2(16, 32, conv1)
    pool1 = MaxPooling2D(pool_size=(2, 2), name='MaxPool1')(conv1)

    conv2 = Residual3(32, 32, pool1)
    conv2 = Residual4(32, 64, conv2)
    pool2 = MaxPooling2D(pool_size=(2, 2), name='MaxPool2')(conv2)

    conv3 = Residual5(64, 64, pool2)
    conv3 = Residual6(64, 128, conv3)
    pool3 = MaxPooling2D(pool_size=(2, 2), name='MaxPool3')(conv3)

    conv4 = Residual7(128, 128, pool3)
    conv4 = Residual8(128, 256, conv4)
    drop4 = Dropout(0.2, name='Dropout1')(conv4)
    pool4 = MaxPooling2D(pool_size=(2, 2), name='MaxPool4')(drop4)

    conv5 = Residual9(256, 256, pool4)
    conv5 = Residual10(256, 128, conv5)
    drop5 = Dropout(0.2, name='Dropout2')(conv5)

    up6 = Conv2D(128,
                 2,
                 activation='relu',
    true = w * (K.log(1 + (K.abs(error) / e)))
    otherwise = K.abs(error) - c
    return tf.where(cond, true, otherwise)


input = Input((192, 192, 3), name='Input')

conv1 = initial_conv_block1(input)
#conv1 = Residual2(32, 64, conv1)
pool1 = MaxPooling2D(pool_size=(2, 2), name='MaxPool1')(conv1)

conv2 = Residual3(64, 128, pool1)
#conv2 = Residual4(128, 128, conv2)
pool2 = MaxPooling2D(pool_size=(2, 2), name='MaxPool2')(conv2)

conv3 = Residual5(128, 256, pool2)
#conv3 = Residual6(256, 256, conv3)
pool3 = MaxPooling2D(pool_size=(2, 2), name='MaxPool3')(conv3)

#conv4 = Residual7(256, 512, pool3)
#conv4 = Residual8(512, 512, conv4)
#drop4 = Dropout(0.2, name='Dropout1')(conv4)
#pool4 = MaxPooling2D(pool_size=(2, 2), name='MaxPool4')(drop4)

conv5 = Residual9(256, 512, pool3)
#conv5 = Residual10(512, 512, conv5)
drop5 = Dropout(0.2, name='Dropout2')(conv5)

#up6 = Conv2D(512, 2, activation = 'relu', padding = 'same', kernel_initializer = 'he_normal', name='UpConv1')(UpSampling2D(size = (2,2), name='Up1')(drop5))
#merge6 = keras.layers.Concatenate(name='Concat1')([drop4,up6])
#conv6 = Residual11(1024, 512, merge6)