shadowcz007 / comfyui-mixlab-nodes

Workflow-to-APP、ScreenShare&FloatingVideo、GPT & 3D、SpeechRecognition&TTS
https://mixlabnodes.com
MIT License
1.12k stars 67 forks source link

Failed to import transformers.models.gpt2.modeling_tf_gpt2 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`. #285

Open gaoshuai1002 opened 1 month ago

gaoshuai1002 commented 1 month ago

1722318476714

BannyLon commented 1 month ago

你当前安装的Keras版本(Keras 3)与你尝试使用的transformers库不兼容。transformers库目前尚未支持Keras 3,因此你需要安装一个与之兼容的Keras版本。建议: pip uninstall keras pip install tf-keras tf-keras 实际上是一个旧的项目,用于在 TensorFlow 1.x 环境中提供类似 Keras 的 API,但现在已经不再需要,因为 TensorFlow 2 已经集成了 tf.keras。

或者更新 transformers 库:pip install --upgrade transformers