caffe例程:The kernel appears to have died. It will restart automatically.与synset_words.txt not found

The kernel appears to have died. It will restart automatically.

报错位置:

caffe.set_mode_cpu()

model_def = caffe_root + 'models/bvlc_reference_caffenet/deploy.prototxt'
model_weights = caffe_root + 'models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel'

net = caffe.Net(model_def,      # defines the structure of the model
                model_weights,  # contains the trained weights
                caffe.TEST)     # use test mode (e.g., don't perform dropout)

解决方法:

import os
caffe_root = '/home/{usrname}/software/caffe-master/'
os.chdir(caffe_root)

caffe_root改为caffe-master的绝对路径,然后使用os.chdir设置

synset_words.txt not found

打开终端去caffe-master/data/ilsvrc12目录下
执行命令:

 ./get_ilsvrc_aux.sh

即可下载synset_words.txt

你可能感兴趣的:(一般问题)