我正在Udacity上学习深度学习课程。在第一个作业中,当我尝试运行下面问题1所示的脚本时,我遇到了这个错误。因此,我尝试卸载了PIL和pillow,然后单独安装它们,但我没有成功。
我需要帮助,我正在使用带Python笔记本的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
在这里可以查看代码。我在第一个问题后的代码块中出现了错误。
我尝试了stack overflow上的解决方法1和解决方法2,但都没有成功。
操作系统:
使用docker,在容器中安装了tensorflow和IPython笔记本电脑。
从python -c "import tensorflow; print(tensorflow.version)"得到输出结果为0.11.0。