Failed to import transformers.models.bart.modeling_tf_bart because no module named 'keras'
The following line of code causes an error: `ModuleNotFoundError: No module named 'keras'` whenever I try to initialize a Bart model:
https://github.com/huggingface/transformers/blob/0a632f076d6b275690176b79c64c5559e1240b05/src/transformers/modeling_tf_utils.py#L39
Replaced it with `from tensorflow.python.keras.saving.hdf5_format import save_attributes_to_hdf5_group` and the error was gone.
Is this a bug or I didn't install all necessary packages?
Just had this exact same issue. Thank you for the fix!<|||||>Shouldn't this be open until gets fixed?<|||||>Confirming the issue still exists when using latest TF (2.11). Downgrading TF to 2.9 fix the issue.<|||||>https://stackoverflow.com/questions/74586892/no-module-named-keras-saving-hdf5-format

working for me on TF==2.9