What TF and keras version this mode require?

#3
by etarism - opened

I have latest tensorflow version installed on my PC, but when I run the code to create the pipeline this error occured.
RuntimeError: Failed to import transformers.models.roberta.modeling_tf_roberta because of the following error (look up to see its traceback):
Your currently installed version of Keras is Keras 3, but this is not yet supported in Transformers. Please install the backwards-compatible tf-keras package with pip install tf-keras.

Please provide detailed module prerequisites for this model.

Kind regards,

Screenshot 2024-06-05 102203.png

Owner

Hi @etarism .

There is no specific TF/Keras version pre-requisite for my model, in particular. It is all dependent on HuggingFace's Transformers and Keras version compatibility.

As the error message suggests, you are running Keras 3, which is currently not supported by HuggingFace Transformers. HF Transformers is the framework you're using to load my model, and any other models on the HF Hub.

To fix this, you can likewise do as suggested in the error message, namely run pip install tf-keras, which will install Keras 2 instead of Keras 3.

This should hopefully fix your issue.

Sign up or log in to comment