Open scarlehoff opened 4 months ago
There is no guarantee either way, some years ago this was their position: https://github.com/keras-team/keras/releases/tag/2.3.0
I'd argue that we should keep using tensorflow.keras
for possible benefits from better integration with tensorflow. If someone is serious about providing a pytorch backend in n3fit
, we can reconsider and in that case swapping out tensorflow.keras
for keras
should be a quick job.
There is no guarantee either way, some years ago this was their position
I think a change of position in 5 years is still more stable than other programs we use
I've needed to add this already.
https://github.com/NNPDF/nnpdf/pull/2110/commits/042d9950889122b729e6e54552a1aa2087ff7c1c
and, more generally, I think it is preferable to stick with keras which is actively being developed, that makes sure that the features we use are not deprecated (as opposed to using some tf.keras
that hasn't been removed yet when it should).
Conda packages can always be a mess, separating keras and tensorflow may also result in problems with compatibility between versions.
Feel free to do this if you want to change it, but I don't think that at this point we can say that separating them is clearly the better choice.
separating keras and tensorflow may also result in problems with compatibility between versions.
No. This doesn't generate (new) problems because most of the calls are already using the separate package. If you do from tensorflow import keras
you are already getting the separated keras package.
But we risk using features that don't actually exist in the separated keras
package (or that have changed name)
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/keras#stop
e.g. https://github.com/NNPDF/nnpdf/blob/4d7284455f4080de0c953350ca742f1830e2b511/n3fit/src/n3fit/backends/keras_backend/MetaModel.py#L24
This will make the code more general. If we can remove the tensorflow dependency as much as possible (it would be impossible right now to remove it completely) that would be great (it means we could test pytorch for instance).
At the moment (tf 2.17)
tensorflow.keras
is still provided, but it is not a given that it will continue like that and in particular the conda forge package for macos (maybe a bug on their side, I'm not sure) seems to be missingtensorflow.keras
.