To Summarize the Error of Ipython Notebook
NO.1 IOError: cannot identify image file
- 操作系统:Ubuntu 15.04
- 编程环境:python 2.7.10 + anaconda 2.3
- 错误源码:
image_root = '/home/yourself/anaconda/lib/python2.7/site-packages/PIL/'
import sys
sys.path.insert(0, image_root)
import Image
im = np.array(Image.open('images/cat.jpg'))
- 错误提示:IOError: cannot identify image file
- 解决方案:将上述源码错误源码中
import Image
改为:
from PIL import Image
- 错误原因:
系统中存在很多Image模块,sys.path中也已经加入很多别的路径,而在编译器搜索Image模块时,可能同时找到很多其他的Image模块,导致系统不知如何选择(或者随机选择),故你需要指定一个Image模块(在这里是PIL Image 模块)给他调用,才不会出错,即加上from PIL(import Image)。
NO.2.build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.10: cannot open shared object file: No such file or directory
- 操作系统:Ubuntu 15.04
- 编程环境:python 2.7.10 + anaconda 2.3
- 错误源码:
(caffe编译命令: make runtest -j4)
- 错误提示:.build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.10: cannot open shared object file: No such file or directory
- 解决方案:终端执行如下命令:
cd ~/anaconda2/lib/
sudo cp libhdf5.so.10 /usr/lib/x86_64-linux-gnu/
sudo cp libhdf5_hl.so.10 /usr/lib/x86_64-linux-gnu/