错误,TensorSliceReader 构造函数不成功:无法找到 ram 解封文件的任何匹配文件
我正在遇到此错误,我无法在jupyter笔记本上删除文件:
import os
import pickle
import joblib
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
filename = open("loan_model3.pkl", "rb")
mdl = pickle.load(filename)
mdl.close()
它始终显示以下错误消息,甚至我都升级了所有库
错误消息:
filenotfounderror:失败的张量构建器构造函数:未能找到RAM的任何匹配文件:// 89506590-EC42-44A9-B67C-3EE4CC8E4CC8E884E/变量/变量/变量,您可能会尝试从计算设备上加载其他设备上的其他设备。考虑在
tf.saved_model.loadoptions
中设置pasteriention_io_device
选项到io_device,例如'/job:local -host'。
我试图升级图书馆,但仍然没有用。
I am running into this error , i can't unpickle a file on my jupyter notebook:
import os
import pickle
import joblib
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
filename = open("loan_model3.pkl", "rb")
mdl = pickle.load(filename)
mdl.close()
and it always shows the below error message , even tho i'vce upgraded all my libraries
Error Message:
FileNotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for ram://89506590-ec42-44a9-b67c-3ee4cc8e884e/variables/variables You may be trying to load on a different device from the computational device. Consider setting the
experimental_io_device
option intf.saved_model.LoadOptions
to the io_device such as '/job:localhost'.
I tried to upgrade my libraries but still didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当我尝试将 Sequential 模型存储在 .pkl 文件中时,我也遇到了同样的错误,因为 Sequential 模型是 TensorFlow Keras 模型,因此我们必须将其存储在 .pkl 文件中。 h5 文件,Keras 以这种格式保存模型,因为它可以轻松地将权重和模型配置存储在单个文件中。
代码:
I got the same error too when I was trying to store my Sequential model in .pkl file, since Sequential model is a TensorFlow Keras model so we have to store it in .h5 file and Keras saves models in this format as it can easily store the weights and model configuration in a single file.
Code:
我不知道你是否还在这里,但我找到了解决方案。基本上你不应该将张量流模型保存到pickle文件中,而是保存到h5文件中
这对我有用。希望这也对您有帮助。
Idk if you are still here but I found the solution. basically you should not save the tensorflow model into a pickle file but instead into h5 file
This worked for me. Hope this helps you too.
这对我有用:
this worked for me:
我遇到了同样的问题,但是通过将模型保存为.h5文件对我有用。现在,我可以加载.h5型号。
I have faced the same issue, but by saving the model as .h5 file worked for me. Now i'm able to load .h5 model.
对我来说,当我尝试从子进程返回 Keras 模型时,就会发生这种情况。这是因为进程间通信使用 pickling 来传输对象。
正如其他人所说,酸洗 keras 模型不起作用。
For me, this happened when I tried to return a Keras model from a child process. This is because inter-process communication uses pickling to transfer objects.
As others have stated, pickling keras models doesn't work.