deel-ai / deel-lip

Build and train Lipschitz constrained networks: TensorFlow implementation of k-Lipschitz layers
https://deel-ai.github.io/deel-lip/
MIT License
89 stars 10 forks source link

deel-lip does not work with tf2.6 #45

Closed thib-s closed 2 years ago

thib-s commented 2 years ago

As tf 2.6 does not include keras, import tf.keras.... breaks. This is not the case with tf 2.5 nor tf 2.7.

A quick fix is to remove support for 2.6. A better fix would be to re-route keras imports specifically for tf2.6

cofri commented 2 years ago

The bug is present in Tensorflow versions 2.6.0 and 2.6.1 when using keras==2.7.0. It can be fixed by manually installing keras==2.6.0 along with TF 2.6.0 or 2.6.1. Tensorflow 2.6.2 works correctly, since it enforces Keras to be 2.6.0. For more information, see https://stackoverflow.com/a/69830680/17578620

Since it is not a bug related to deel-lip, but only related to TF/Keras, I think it's preferred not to change anything in deel-lip. However, if necessary, we could add a disclaimer to warn users that TF and Keras versions must match for 2.6.*.