[英]ModuleNotFoundError sklearn.preprocessing, Pickle
I have trouble with the execution of my code in Pycharm and Spyder.我在 Pycharm 和 Spyder 中执行我的代码时遇到问题。 Beside updating all the modules with pip update --all
.除了使用pip update --all
更新所有模块。
In my console, I have this message在我的控制台中,我收到了这条消息
[scaler, model_power, model_alpha, model_d632] = pickle.load(open("simulator/sag.sav", 'rb'))
ModuleNotFoundError: No module named 'sklearn.preprocessing.data'
I don't know what's wrong with my code or my modules' version.我不知道我的代码或模块的版本有什么问题。
Any help?有什么帮助吗?
Upgrade scikit-learn:升级 scikit-learn:
pip install -U scikit-learn
And try first to dump.并尝试先转储。 For example:例如:
filename = "simulator/sag.sav"
pickle.dump(filename, open(filename, 'wb'))
model = pickle.load(open(filename, 'rb'))
print("model loaded")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.