Skip to content
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

Cannot use keras_spiking.ModelEnergy on model that have a concatenation layer, such as DenseNet121 #24

Open
JavierZazueta opened this issue Jan 12, 2022 · 0 comments

Comments

@JavierZazueta
Copy link

I am trying to get some energy values from a DenseNet architecture and when I run the code below I get a valueError (as shown below). I tried narrowing down where the issue occurs and found that it first happens at a layers.Concatenate call in the keras implementation. Has anyone seen a similar issue to this? When I use keras’ vgg16 implementation it works, which doesn’t have a Concatenate.

from tensorflow.keras.applications import DenseNet121
import keras_spiking
import numpy as np

denseNet_model = DenseNet121(
weights=None, include_top=True, input_shape=(224, 224, 3)
)

energy = keras_spiking.ModelEnergy(denseNet_model, example_data=np.ones((32, 224, 224, 3)) * 3)

ValueError: could not broadcast input array from shape (32,56,56,64) into shape (32,56,56)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant