tried conda and venv.
No model was supplied, defaulted to t5-small and revision d769bba (https://huggingface.co/t5-small).
Using a pipeline without specifying a model name and revision in production is not recommended.
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1146, in _get_module
return importlib.import_module("." + module_name, self.__name__)
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/models/t5/modeling_tf_t5.py", line 35, in <module>
from ...modeling_tf_utils import (
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/modeling_tf_utils.py", line 69, in <module>
from keras.engine import data_adapter
ModuleNotFoundError: No module named 'keras.engine'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "sumary_service.py", line 3, in <module>
summarizer = pipeline("summarization")
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/pipelines/__init__.py", line 779, in pipeline
framework, model = infer_framework_load_model(
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/pipelines/base.py", line 238, in infer_framework_load_model
_class = getattr(transformers_module, f"TF{architecture}", None)
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1137, in __getattr__
value = getattr(module, name)
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1136, in __getattr__
module = self._get_module(self._class_to_module[name])
File "/opt/homebrew/Caskroom/miniconda/base/envs/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1148, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.t5.modeling_tf_t5 because of the following error (look up to see its traceback):
No module named 'keras.engine'
System Info
osX silicon M1
(also tested with tensforflow 2.13 rc0)
tried conda and venv.
also tested 4.29.1
Who can help?
@gante and @Rocketknight1
No response
Information
Reproduction
**error does not occur when using pytorch**Expected behavior
transformer library does not raise exception