qiexing / face-landmark-localization

cnn network predict face landmarks (68 points) and head pose (3d pose, yaw,roll,pitch).
410 stars 184 forks source link

cpu error when predict image #8

Closed XiaXuehai closed 8 years ago

XiaXuehai commented 8 years ago

I use the cpu only caffe to predict image.got the errror like this:

I0718 11:43:22.602149 1904979968 net.cpp:274] Network initialization done.
I0718 11:43:23.239444 1904979968 net.cpp:752] Ignoring source layer MyData
I0718 11:43:23.320868 1904979968 net.cpp:752] Ignoring source layer loss
I0718 11:43:23.320929 1904979968 net.cpp:752] Ignoring source layer poseloss
F0718 11:43:23.346355 1904979968 common.cpp:66] Cannot use GPU in CPU-only Caffe: check mode.
*** Check failure stack trace: ***
Abort trap: 6

I have modified the landmarkpredict.py:

def predictImage(filename):
    vgg_point_MODEL_FILE = 'model/deploy.prototxt'
    vgg_point_PRETRAINED = 'model/68point_dlib_with_pose.caffemodel'
    mean_filename='model/VGG_mean.binaryproto'
    vgg_point_net=caffe.Net(vgg_point_MODEL_FILE,vgg_point_PRETRAINED,caffe.TEST)
    caffe.set_mode_cpu()
    # caffe.set_mode_gpu()
    caffe.set_device(0)
    f = open(filename)
qiexing commented 8 years ago

@XiaXuehai You should also comment the next line caffe.set_device(0).

XiaXuehai commented 8 years ago

thx.