python - 加载 Fashion_mnist 数据需要太多时间

标签 python tensorflow keras mnist

我在 Windows 10 上使用 python 3.6.6、tensorflow 1.11.0 和 keras 2.1.6 按照以下博客作为导入和加载数据的指南。

https://www.tensorflow.org/tutorials/keras/basic_classification

shell IDLE 打印太多输出并无限期地继续。

我的代码中的这一行似乎是问题所在:

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

下面是我的 shell IDLE 执行的几行输出:

1.11.0

Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/train-images-idx3-ubyte.gz

    8192/26421880 [..............................] - ETA: 0s
   16384/26421880 [..............................] - ETA: 2:05
  172032/26421880 [..............................] - ETA: 21s 
  450560/26421880 [..............................] - ETA: 11s
  933888/26421880 [>.............................] - ETA: 7s 
 1507328/26421880 [>.............................] - ETA: 5s
 2056192/26421880 [=>............................] - ETA: 4s
 2670592/26421880 [==>...........................] - ETA: 4s
 3358720/26421880 [==>...........................] - ETA: 3s
 3833856/26421880 [===>..........................] - ETA: 3s
 4259840/26421880 [===>..........................] - ETA: 3s
 4489216/26421880 [====>.........................] - ETA: 3s
 4931584/26421880 [====>.........................] - ETA: 3s
 4997120/26421880 [====>.........................] - ETA: 3s
 5005312/26421880 [====>.........................] - ETA: 3s
 5013504/26421880 [====>.........................] - ETA: 4s
 5021696/26421880 [====>.........................] - ETA: 4s
 5029888/26421880 [====>.........................] - ETA: 4s
 5038080/26421880 [====>.........................]

为什么 shell 不停止? 我感谢任何帮助。

最佳答案

我认为 IDLE 的 shell 不够快,可能会减慢文件下载速度,请尝试从终端运行相同的 python 代码,因为它将下载文件,并且只需执行一次。

关于python - 加载 Fashion_mnist 数据需要太多时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52685774/

相关文章:

python - 用python中的另一个子列表替换一个子列表

python - Tensorflow - 无法在 Estimator 中使用带有 MirroredStrategy 分布的 BasicLSTMCell

python - 如何在spyder中的ipython中释放keras中的GPU资源?

python - 使用tensorflow.keras连接两个模型

python - Keras 自定义损失计算不正确

python - 如何获取有界的python scipy类型的连续rv分布对象?

python - 如何设置 python (rpy2) 执行 R 代码的时间限制?

python - 有条件地创建零梯度的自定义 Keras 损失函数

python - 我从 Quandl 检索股票数据时哪里出错了?

python - 对 tensorflow 图的部分进行基准测试的正确方法是什么?