简体   繁体   English

在 Google Colab 中使用特定版本的 package

[英]Use specific version of package in Google Colab

I have some files with models serialized with pickle , but now when i try to unserialize them, i get:我有一些带有用pickle序列化的模型的文件,但是现在当我尝试对它们进行反序列化时,我得到:

UserWarning: Trying to unpickle estimator LogisticRegression from version 1.0.1 when using version 1.0.2.用户警告:在使用 1.0.2 版本时,尝试从 1.0.1 版本中解开估计器 LogisticRegression。 This might lead to breaking code or invalid results.这可能会导致破坏代码或无效结果。 Use at your own risk.使用风险自负。 For more info please refer to: https://scikit-learn.org/stable/modules/model_persistence.html#security-maintainability-limitations更多信息请参考: https://scikit-learn.org/stable/modules/model_persistence.html#security-maintainability-limitations

How can i specify colab to use that version of pickle我如何指定 colab 使用该版本的泡菜

Pickle is part of The Python Standard Library, so you cannot change its version without changing your Python version. Pickle是 Python 标准库的一部分,因此您不能在不更改 Python 版本的情况下更改其版本。 However, that warning message refers to the version of Scikit-learn , not pickle .但是,该警告消息是指Scikit-learn的版本,而不是pickle You can install Scikit-learn 1.0.1 as follows:您可以按如下方式安装Scikit-learn 1.0.1:

!pip install scikit-learn==1.0.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM