LoginSignup
6
4

More than 5 years have passed since last update.

[はじめての深層学習]Deelインストール後のサンプル実行時のメモ

Posted at

shi3zさんの作られたDeelをインストールしてみました。
※参考書籍をご参照下さい
CUDAとかgitとかpythonとかはDIGITSで構築したり
別の参考書籍でChainerをインストールしていたので
詳細は飛ばしてtiny.pyの実行から始めたのですが
いきなりエラーに見舞われたので上手くいった手順メモです。

書籍内のリスト1.1の tiny.pyを実行すると
下記のようにprotobuf2がないと言われる。

python tiny.py
Traceback (most recent call last):
  File "tiny.py", line 2, in <module>
    from deel.network import *
  File "/home/keigo/Development/deel/deel/network/__init__.py", line 5, in <module>
    from deel.model.caffefunction import CaffeFunction
  File "/home/keigo/Development/deel/deel/model/caffefunction.py", line 38, in <module>
    from chainer.links.caffe.protobuf2 import caffe_pb2 as caffe_pb
ImportError: No module named protobuf2

tiny.pyが実行出来た方法

chainer のバージョンは参考書の中では
1.14.1との事でしたがそのバージョンを指定したらこれまた
バージョンが存在しないと言われます。
1.17.0をインストールしてみたら上手くサンプルは動きました。

インストール

$ sudo pip install chainer=="1.17.0"

Chainerのバージョン指定インストール

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import chainer
chainer.__version__
>>> chainer.__version__
'1.17.0'

tiny.py実行

$ python tiny.py
Loading bvlc_alexnet.caffemodel
Converting from bvlc_alexnet.caffemodel
data 5
conv1 4
relu1 18
norm1 15
pool1 17
conv2 4
relu2 18
norm2 15
pool2 17
conv3 4
relu3 18
conv4 4
relu4 18
conv5 4
relu5 18
pool5 17
fc6 14
relu6 18
drop6 6
fc7 14
relu7 18
drop7 6
fc8 14
loss 21
#1 | loupe, | 22.5%
#2 | hook, | 10.0%
#3 | corkscrew, |  5.2%
#4 | combination |  4.2%
#5 | stethoscope |  4.1%
#6 | buckle |  4.0%
#7 | face |  3.3%
#8 | stopwatch, |  2.5%
#9 | cassette |  2.0%
#10 | analog |  1.4%
#11 | knot |  1.4%
#12 | digital |  1.4%
#13 | chain |  1.2%
#14 | padlock |  1.2%
#15 | muzzle |  1.1%
#16 | magnetic |  1.0%
#17 | lens |  1.0%
#18 | sunglasses, |  0.9%
#19 | whistle |  0.8%
#20 | nail |  0.8%

まぁ、本を読み進める上でバージョンがこれでいいのか
怪しいですがとりあえず、このまま進めていき
駄目だったら本記事を併せて修正します。
まずは備忘録的にメモを残します。

参考書
はじめての深層学習(ディープラーニング)プログラミング
github uei/deel

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4