每次隔几天重新打开notebook都会出现这个问题,报错信息如下
root@dsw:/mnt/workspace# swift
2024-11-06 08:21:10.009763: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0
.
2024-11-06 08:21:10.049513: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-11-06 08:21:10.776097: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/transformers/activations_tf.py", line 22, in
import tf_keras as keras
ModuleNotFoundError: No module named 'tf_keras'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1603, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/site-packages/transformers/modeling_tf_utils.py", line 38, in
from .activations_tf import get_tf_activation
File "/usr/local/lib/python3.10/site-packages/transformers/activations_tf.py", line 27, in
raise ValueError(
ValueError: 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
.