-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualizing Intermediate Layer Activations #1
Comments
Hi @NassimaD
|
Hi |
Hi @NassimaD I ran same code with image input size of (224, 224, 3) and it is running fine with no errors. Maybe what you can try is instead of running whole code, just try to run only below part of code with any image.
If you are having trouble with calculating how size of display_grid is calculated, its simple actually. Since, the images are formed for every activation layer, lets take first activation layer which in this case is first Convolution layer Conv1D in InceptionV3 network So, n_features=32 (number of features given for first Convolution layer) Then, this grid is filled row-wise with images. You can confirm values of n_features and size using model.summary() after creating the model. |
I'm getting this error in Visualizing Intermediate Layer Activations part, I used this model
def M_Model():
base_model = InceptionV3(weights=None, include_top=False, input_shape=(3, 224, 224))
# Classification block
x = GlobalAveragePooling2D(name='avg_pool')(base_model.output)
x = Dense(128, activation='relu')(x)
x = Dropout(0.2)(x)
x = Dense(clse, activation='softmax')(x)
model = Model(inputs=base_model.input, outputs=x)
return model
and the error is :
display_grid[col * size: (col + 1) * size, row * size: (row + 1) * size] = channel_image
ValueError: could not broadcast input array from shape (32,111) into shape (32,32)
The text was updated successfully, but these errors were encountered: