【问题标题】:why my code can not load MNIST dataset from google?为什么我的代码无法从谷歌加载 MNIST 数据集?
【发布时间】:2019-01-28 05:59:26
【问题描述】:

我需要你的帮助

我无法从 this. 加载 MNIST 数据集

我的系统环境如下
操作系统:Ubuntu 16.04
Python 版本:3.5
TensorFlow 版本:1.12

以下是我的代码:

import tensorflow as tf
import numpy as np

train, test = tf.keras.datasets.mnist.load_data()
train_x, train_y = train

dataset = tf.data.Dataset.from_tensor_slices(({"image":train_x}, train_y))
dataset = dataset.shuffle(100000).repeat().batch(10)

iterator = dataset.make_one_shot_iterator()
next_element = iterator.get_next()

sess = tf.Session()

print(sess.run(next_element))

当我在我的计算机上运行此代码时,它卡在 ETA0 并且没有像这样从谷歌完成下载。

从here.下载数据
11476992/11490434 [============================>.] - 预计到达时间:0s

这个问题我该怎么办,请帮帮我... :(

【问题讨论】:

  • 尝试手动下载数据,然后像这样传递路径example
  • 请检查此目录是否有任何数据集~/.keras
  • @Anwarvic 嘿!有用!多谢兄弟!我下载了数据集并将其手动放置到~/.keras/datasets,它可以工作!再次感谢!

标签: python linux ubuntu tensorflow


【解决方案1】:

使用 Python3 在我的 Linux 机器上运行良好,一定是网络问题。 尝试更改互联网连接或检查代理(如果有),然后重试。

【讨论】:

    【解决方案2】:

    您可能在代理后面...例如,如果您在公司网络上。

    在 Windows 上,Python 解释器将从您的系统环境变量中获取代理:

    设置系统变量 HTTP_PROXY 到值http://yourproxy

    和系统变量 HTTPS_PROXY 到值http://yourproxy

    或者,您可以根据此帖子的答案在特定的 Python 终端会话中设置环境 set proxy in python session

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-28
      • 1970-01-01
      • 2020-12-11
      • 2020-01-05
      • 1970-01-01
      相关资源
      最近更新 更多