【发布时间】:2017-04-28 16:56:48
【问题描述】:
我正在开设一个关于 udacity 的深度学习课程。对于第一个任务,当我尝试运行问题 1 下方的脚本时,我收到了这个错误。所以我尝试卸载 PIL 和枕头,然后单独安装它们,但我没有成功。 我需要帮助的家伙。我正在使用带有 python notebook 的 tensorflow docker 图像。
# These are all the modules we'll be using later. Make sure you can import them
# before proceeding further.
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import scipy
import tarfile
from IPython.display import display, Image
from scipy import ndimage
from sklearn.linear_model import LogisticRegression
from six.moves.urllib.request import urlretrieve
from six.moves import cPickle as pickle
# Config the matplotlib backend as plotting inline in IPython
%matplotlib inline
url = 'http://commondatastorage.googleapis.com/books1000/'
last_percent_reported = None
def download_progress_hook(count, blockSize, totalSize):
percent = int(count * blockSize * 100 / totalSize)
if last_percent_reported != percent:
if percent % 5 == 0:
sys.stdout.write("%s%%" % percent)
sys.stdout.flush()
else:
sys.stdout.write(".")
sys.stdout.flush()
last_percent_reported = percent
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/udacity/1_notmnist.ipynb
您可以在此处查看代码。问题 1 后代码块中出现错误 Error Image
我尝试了这两个链接或解决方案中描述的所有内容:
操作系统:
使用 docker 和 tensorflow 安装在带有 IPython notebook 的容器中。
python -c "import tensorflow; print(tensorflow.version)" 的输出。
0.11.0
【问题讨论】:
-
你安装了 PIL 吗?如果没有,请点击错误消息中的链接
-
@lhk 是的,我做到了,它给了我同样的错误。
标签: python python-2.7 tensorflow python-imaging-library pillow