Last active
January 16, 2019 11:54
-
-
Save afg1/83d3d462e0b96b54e9dd9ad4466658bd to your computer and use it in GitHub Desktop.
3D fcn network to reproduce bug in keras model.summary() output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import keras | |
from keras.layers import Conv3D, MaxPooling3D, Conv3DTranspose, Input | |
from keras.models import Model | |
def FCN3DNet(): | |
inputLayerA = Input(shape=(96,96,96,1)) | |
inputLayerB = Input(shape=(96,96,96,1)) | |
totalInput = keras.layers.concatenate([inputLayerA, inputLayerB]) | |
x = Conv3D(16, (2,2,2), padding='same', data_format='channels_last', activation='relu')(totalInput) | |
x = MaxPooling3D(pool_size=(2,2,2))(x) | |
x = Conv3D(32, (2,2,2), padding='same', activation='relu')(x) | |
x = MaxPooling3D(pool_size=(2,2,2))(x) | |
x = Conv3D(64, (2,2,2), padding='same', activation='relu')(x) | |
x = MaxPooling3D(pool_size=(2,2,2))(x) | |
x = Conv3DTranspose(32, (2,2,2), strides=(2,2,2), padding='same', activation='relu')(x) | |
x = Conv3DTranspose(16, (2,2,2), strides=(2,2,2), padding='same', activation='relu')(x) | |
x = Conv3DTranspose(3, (2,2,2), strides=(2,2,2), padding='same', activation='linear')(x) | |
model = Model(inputs=[inputLayerA, inputLayerB], outputs=x) | |
return model | |
model = FCN3DNet() | |
print(model.summary()) | |
## The shapes reported in this summary have the number of channels truncated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment