raghakot / keras-vis

Neural network visualization toolkit for keras
https://raghakot.github.io/keras-vis
MIT License
2.97k stars 664 forks source link

3D MRI Image #224

Open StephDocTUM opened 4 years ago

StephDocTUM commented 4 years ago

Hi,

I want to use keras-vis for a 3D mri image with the following model:

`def standart_model(tiefe, breite, länge,color_depth = 1): model = Sequential()
model.add(Conv3D(8,(3, 3, 3), activation='relu', padding='same', name='conv1', strides=(1, 1, 1), input_shape=(tiefe, breite, länge, color_depth),data_format="channels_last")) model.add(MaxPool3D(pool_size=(3, 2, 2), strides=(1, 2, 2), padding='valid', name='pool1')) model.add(Conv3D(4, (3, 3, 3), activation='relu', padding='same', name='conv2', strides=(1, 1, 1))) model.add(MaxPool3D(pool_size=(2, 2, 2), strides=(2, 2, 2), padding='valid', name='pool2')) model.add(Flatten())

model.add(Dense(1, activation='relu', name='fc7'))

model.compile(loss='mean_squared_error', optimizer='rmsprop')
return model`

But I always receive the following error:

ValueError: slice index 8 of dimension 4 out of bounds. for 'strided_slice_54' (op: 'StridedSlice') with input shapes: [?,176,256,256,8], [3], [3], [3] and with computed input tensors: input[1] = <0 0 8>, input[2] = <0 0 9>, input[3] = <1 1 1>.

Did anyone make it work with a 3D image?

Best, Stephan