Hello!
I need some help to fix my “RunTimeError” message.
The code used:
from transformers import TFAutoModel
checkpoint=“distilbert-base-uncased-finetuned-sst-2-english”
model=TFAutoModel.from_pretrained(checkpoint)
And the long error message
RuntimeError: Failed to import transformers.models.distilbert.modeling_tf_distilbert because of the following error (look up to see its traceback):
No module named ‘keras.saving.hdf5_format’
I cant see where I have done something wrong, it seems more there is something wrong with the model?
After installed the Tensorflow as mentioned, I now receive a new RunTime Error:
"RuntimeError: Failed to import transformers.models.distilbert.modeling_tf_distilbert because of the following error (look up to see its traceback):
Duplicate registrations for type ‘experimentalOptimizer’ "
@chem1 I tried this:
from transformers import TFAutoModel
checkpoint = ‘distilbert-base-uncased-finetuned-sst-2-english’
model = TFAutoModel.from_pretrained(checkpoint)
I am getting this:
RuntimeError: Failed to import transformers.models.distilbert.modeling_tf_distilbert because of the following error (look up to see its traceback):
module ‘tensorflow._api.v2.compat.v2.internal’ has no attribute ‘register_load_context_function’
I am using latest version of everything. More specifically, transformers = 4.38.2, tensorflow = 2.16, keras = 3.1.1, protobuf = 5.26.0