SHARE
TWEET

Untitled

a guest Jun 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. input = Input(shape=(224,224,3), name='input_1')
  2.     base_model = keras.applications.VGG16(weights='imagenet', include_top=False)
  3.     for layer in base_model.layers:
  4.         layer.trainable=False
  5.  
  6.     x = base_model(input)
  7.     x = Conv2DTranspose(filters=256, kernel_size=(4,4), strides=(2, 2), activation='relu',
  8.                         name='deconv1', padding='valid',
  9.                         output_padding=(1,1),
  10.                         kernel_initializer='random_uniform')(x)
  11.     x = BatchNormalization()(x)
  12.     x = Dropout(0.5)(x)
  13.     x = Conv2D(filters=15, kernel_size=(1,1), name='final_conv', padding='same')(x)
  14.      
  15. <tf.Tensor 'vgg16/block5_pool/MaxPool:0' shape=(?, 7, 7, 512) dtype=float32>
  16.      
  17. Layer (type)                 Output Shape              Param #  
  18. =================================================================
  19. input_1 (InputLayer)         (None, 224, 224, 3)       0        
  20. _________________________________________________________________
  21. vgg16 (Model)                multiple                  14714688  
  22. _________________________________________________________________
  23. deconv1 (Conv2DTranspose)    (None, 17, 17, 256)       2097408  
  24. _________________________________________________________________
  25. batch_normalization_11 (Batc (None, 17, 17, 256)       1024      
  26. _________________________________________________________________
  27. dropout_7 (Dropout)          (None, 17, 17, 256)       0        
  28. _________________________________________________________________
  29. final_conv (Conv2D)          (None, 17, 17, 15)        3855      
  30. =================================================================
  31. Total params: 16,816,975
  32. Trainable params: 2,101,775
  33. Non-trainable params: 14,715,200
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top