简体   繁体   English

如何在 TensorFlow 数据集中使用 Mnist 数据集?

[英]how I can work with Mnist dataset in the TensorFlow-datasets?

Hey I want to use data set MNist from TensorFlow-datasets.嘿,我想使用来自 TensorFlow-datasets 的数据集 MNist。 I used the following code:我使用了以下代码:

import tensorflow as tf
import tensorflow_datasets as tfds
mnist_dataset, mnist_info = tfds.load(name='mnist', with_info=True, as_supervised=True)

I got error:我收到错误:

ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html

I had the same issue.我遇到过同样的问题。 For some reason TensorFlow Datasets doesn't install the ipywidgets dependency.由于某种原因,TensorFlow Datasets 没有安装ipywidgets依赖项。 I tried installing ipywidgets myself and in fact it broke the whole of JupyterLab.我尝试自己安装ipywidgets ,实际上它破坏了整个 JupyterLab。 For me it that was a problem with the current version of ipywidgets ( 7.5.1 ).对我来说,这是当前版本的ipywidgets ( 7.5.1 ) 的问题。 I tried using the previous version,我尝试使用以前的版本,

conda install ipywidgets==7.4.2

and now TFDS can download properly.现在TFDS可以正常下载了。

(Poor code from TensorFlow, by the way. This ipywidgets business is just there for making a pretty loading bar if you're using TFDS in Jupyter; it shouldn't cause everything to fall over when there's a problem. Even after successfully installing the older version I couldn't make the widget rendering work in Jupyter, it prints a bunch of HTML stuff instead, but I don't care, at least it doesn't crash.) (顺便说一句,来自 TensorFlow 的代码很差。如果您在 Jupyter 中使用 TFDS,这个ipywidgets业务只是为了制作一个漂亮的加载栏;当出现问题时,它不应该导致一切崩溃。即使在成功安装旧版本我无法在 Jupyter 中进行小部件渲染,它会打印一堆 HTML 的东西,但我不在乎,至少它不会崩溃。)

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

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