Keras:下载Fashion_MNIST数据时出错 [英] Keras: Error when downloading Fashion_MNIST Data

查看:677
本文介绍了Keras:下载Fashion_MNIST数据时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Fashion MNIST下载数据,但是会产生错误.最初,它正在下载并且可以正常工作,但是由于必须关闭计算机,我不得不终止它.一旦我再次打开文件,它给我一个错误.我不确定是什么问题,但这是因为我已经下载了部分数据,而keras无法识别吗?我在conda环境中使用Jupyter笔记本电脑

I am trying to download data from Fashion MNIST, but it produces an error. Originally, it was downloading and working properly, but I had to terminate it because I had to turn off my computer. Once I opened the file up again, it gives me an error. I'm not sure what the problem is, but is it because I already downloaded some parts of the data once, and keras doesn't recognize that? I am using Jupyter notebook in a conda environment

这是图像的链接:

https://i.stack.imgur.com/wLGDm.png

推荐答案

您错过了将tf.添加到行

fashion_mnist = keras.datasets.fashion_mnist

以下代码非常适合我. tensorflow文档这里.

The below code works perfectly for me. Importing the fashion_mnist dataset has been outlined in tensorflow documention here.

将您的代码更改为:

import tensorflow as tf

fashion_mnist = tf.keras.datasets.fashion_mnist

(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()

,或者在下面使用更好的方法进行操作.这样可以避免创建额外的变量fashion_mnist:

or, use the better way to do it below. This avoids creating an extra variable fashion_mnist:

import tensorflow as tf

(train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.fashion_mnist.load_data()

我在Windows 10 x64 OS上使用tensorflow 1.9.0,keras 2.2.2和python 3.6.6.

I am using tensorflow 1.9.0, keras 2.2.2 and python 3.6.6 on Windows 10 x64 OS.

这篇关于Keras:下载Fashion_MNIST数据时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆