To Summarize the Error of Ipython Notebook

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/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值