【问题标题】:Issue importing MNIST dataset from sklearn [duplicate]从 sklearn 导入 MNIST 数据集的问题 [重复]
【发布时间】:2022-02-25 23:39:40
【问题描述】:

如 pg 中所写。 79 Hands-On Machine Learning with Scikit-Learn and Tensorflow,我尝试导入书中告诉我的 MNIST 数据。该代码不起作用,我查看了其他stackoverflow问题和github问题,但这些解决方案都没有奏效,所以我想问是否有人知道解决方案。再次感谢您帮助我解决此问题。

from sklearn.datasets import fetch_mldata
minst = fetch_mldata('MNIST Original')

【问题讨论】:

  • 你是如何安装 sklearn 的?
  • @endive1783 我有“scikit-learn-1.0.2”和“scipy-1.8.0”

标签: scikit-learn mnist


【解决方案1】:

函数 fetch_mldata 已在 sklearn 中替换,您应该使用 fetch_openml 代替:

from sklearn.datasets import fetch_openml
mnist = fetch_openml('mnist_784')

但是我不确定这本书是否与最新版本的 sklearn 保持同步,您可能应该将您的 sklearn 版本降级到书中使用的版本,或者使用与当前版本保持最新的书籍。

【讨论】:

    猜你喜欢
    • 2020-03-12
    • 2018-04-29
    • 2018-08-11
    • 1970-01-01
    • 2020-12-11
    • 2020-09-10
    • 2020-04-10
    • 1970-01-01
    • 2018-09-27
    相关资源
    最近更新 更多