如何求解不称为' keras.saving.pickle_utils'错误?
import numpy as np
import cv2
import pickle
frameWidth= 640 # CAMERA RESOLUTION
frameHeight = 480
brightness = 180
threshold = 0.75 # PROBABLITY THRESHOLD
font = cv2.FONT_HERSHEY_SIMPLEX
# SETUP THE VIDEO CAMERA
cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10, brightness)
# IMPORT THE TRANNIED MODEL
pickle_in=open("model_trained.p","rb")
model=pickle.load(pickle_in)
这给了我这个错误: ModulenotFoundError:没有名为'Keras.saving.pickle_utils'的模块 如何解决?
PS:我正在尝试在Raspberry Pi 3上运行此代码。我已经安装了TensorFlow及其软件包,并试图导入TensorFlow和Keras,但我没有遇到任何问题。
import numpy as np
import cv2
import pickle
frameWidth= 640 # CAMERA RESOLUTION
frameHeight = 480
brightness = 180
threshold = 0.75 # PROBABLITY THRESHOLD
font = cv2.FONT_HERSHEY_SIMPLEX
# SETUP THE VIDEO CAMERA
cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10, brightness)
# IMPORT THE TRANNIED MODEL
pickle_in=open("model_trained.p","rb")
model=pickle.load(pickle_in)
this gives me this error:
ModuleNotFoundError: No module named 'keras.saving.pickle_utils'
How to solve it?
P.S: I'm trying to run this code on raspberry pi 3. I've installed tensorflow and its packages and tried to import tensorflow and keras, and I did not face any problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试降级您的TensorFlow版本。
请看一下: https://github.com/github.com/hugginggingface/transformers/transformers/issues/issues/18912
try to downgrade your tensorflow version.
Look at this: https://github.com/huggingface/transformers/issues/18912