ModulenotFoundError:没有名为' keras.saving'

发布于 2025-02-08 13:03:06 字数 278 浏览 2 评论 0原文

完全错误:

Using TensorFlow backend.
Traceback (most recent call last):
  File "file.py", line 32, in <module>
    pickled_model = pickle.load(open('model.pkl', 'rb'))
ModuleNotFoundError: No module named 'keras.saving'

我无法解决此错误。 感谢您的帮助:)

Complete Error:

Using TensorFlow backend.
Traceback (most recent call last):
  File "file.py", line 32, in <module>
    pickled_model = pickle.load(open('model.pkl', 'rb'))
ModuleNotFoundError: No module named 'keras.saving'

I am not able to solve this error.
Thanks for the help:)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

放飞的风筝 2025-02-15 13:03:06

我在编译以下代码时遇到了相同的错误,

import tensorflow
import pickle
import streamlit as st
from streamlit_option_menu import option_menu
from tensorflow import keras

pickle_in = open("C:/Users/zahir/Desktop/Heart_Disease_prediction/Saved_model/classifier.pkl", 'rb')
tb_model = pickle.load(pickle_in)

我使用腌制库保存了模型并尝试打开。

I am getting the same error while compiling the following code

import tensorflow
import pickle
import streamlit as st
from streamlit_option_menu import option_menu
from tensorflow import keras

pickle_in = open("C:/Users/zahir/Desktop/Heart_Disease_prediction/Saved_model/classifier.pkl", 'rb')
tb_model = pickle.load(pickle_in)

I saved model using pickle library and trying to open.

舂唻埖巳落 2025-02-15 13:03:06

我想到了Keras 2.3和Tensorflow 2.5的问题。升级到Keras 2.9和Tensorflow 2.9后,解决了问题。

I came up with this problem with Keras 2.3 and TensorFlow 2.5. After I upgrade to Keras 2.9 and TensorFlow 2.9, the problem was solved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文