2018年9月15日土曜日

Caffe-ing GoogleNet Training with ImageNetDogs

There are several networks examples in Caffe distribution. So I suppose I would run caffe with these networks. To do so, a bunch of labeled images are necessary. After googling the net,  I found ImageNet Dogs from Stanford University would be nice.
First of all, I have to restore the images in the lmdb database. Fortunately, there is a script into it. My GPU memory only have 2GB, so I change the image size from 256 to 128.

I take GoogleNet for the first try. The ProtoBuf text should be changed because the number of classification is changed from 1000 to 120. There are three to be changed.
The other lines to be changed are crop_size. The default crop_size is 224 but this is smaller than the prepared image size 128. So I replace the 224 to 112. There are 2 places to be changed.

These are the all to be changed. So we are ready to LEARN now.

But Caffe be down at loop5.
I0915 21:26:05.566467 2647491520 net.cpp:157] Top shape: 32 1024 3 3 (294912)
I0915 21:26:05.566473 2647491520 net.cpp:165] Memory required for data: 442749448
I0915 21:26:05.566479 2647491520 layer_factory.hpp:77] Creating layer pool5/7x7_s1
I0915 21:26:05.566488 2647491520 net.cpp:100] Creating Layer pool5/7x7_s1
I0915 21:26:05.566493 2647491520 net.cpp:434] pool5/7x7_s1 <- inception_5b="" output="" span="">
I0915 21:26:05.566540 2647491520 net.cpp:408] pool5/7x7_s1 -> pool5/7x7_s1

F0915 21:26:05.566615 2647491520 blob.cpp:32] Check failed: shape[i] >= 0 (-1 vs. 0) 

Top shape: 32 1024 3 3 indicates the kernel size should be smaller than 3. Current value is 7 at pool5 layer. So the error indicates kernel size 7 should be changed to 3. Now the network seems to work fine with new specifications. Let me see...

0 件のコメント:

コメントを投稿