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

Known issue: Conversion of CNNs for use with pyNN (Nest, Brian, ...) simulators does not work with input models trained using keras versions > 2.1.6. #25

Closed
rbodo opened this issue Nov 17, 2018 · 2 comments

Comments

@rbodo
Copy link
Contributor

rbodo commented Nov 17, 2018

The conversion of CNNs for use with pyNN (Nest, Brian, ...) simulators works with models trained using a keras version <= 2.1.6 (like the LeNet example provided with the toolbox), but not with models trained on newer keras versions. I believe the reason is that Keras changed something with the Flatten layer (you can now specify the image data format within the Flatten layer). The convolution layers are converted fine even with a new keras model, but the converted dense layers do not match the original ANN layers any more.

Workaround:
An input model trained with the latest keras version will work fine on pyNN simulators if the image_data_format was set to channels_first in the keras config file, and the argument image_data_format=channels_last was passed to the Flatten layer during training.

This issue can probably be fixed by adapting this for-loop:

for fout in range(weights.shape[3]):

Unfortunately, I won't be able to tackle this compatibility issue any time soon. Any contribution would be appreciated.

Note: The INI simulator is not affected.

@rbodo
Copy link
Contributor Author

rbodo commented Mar 15, 2019

Update: We have solved this issue now, but will have to wait with open-sourcing it until later this year.

@rbodo rbodo removed the help wanted label Mar 15, 2019
@rbodo
Copy link
Contributor Author

rbodo commented Oct 12, 2019

Solved in release 0.3.1.

@rbodo rbodo closed this as completed Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant