larq / zoo

Reference implementations of popular Binarized Neural Networks
https://docs.larq.dev/zoo
Apache License 2.0
104 stars 18 forks source link

Add compatibility with Keras export script #455

Closed CNugteren closed 1 year ago

CNugteren commented 1 year ago

With this script Keras hides internal functions. Since obtain_input_shape is an internal function used by the Larq zoo, that no longer works with Keras 2.13 on my system. This is a work-around. Of course a proper solution would be to only use public functions.

Since the Keras export script is currently only targeting x86-64 Linux, I solved this by using a try-except rather than an if version.parse() statement.