matcaffe 使用中,matlab直接错误退出问题

来源:互联网 发布:oracle数据库课程设计 编辑:程序博客网 时间:2024/06/15 16:01

1、首先需要配置matlab接口环境,并定义是否开启GPU加速
caffe.set_mode_gpu(); %GPU加速模式
caffe.set_mode_cpu(); %CPU加速模式
如果没有配置成功,则会报错:无法找到caffe_

2、加载训练好的模型
net = caffe.Net(net_model,weight,’test’)
net_model 通常为deploy.prototxt
调用此句,如果net 和 weight不配套,则会出现matlab卡死并退出的问题,没有任何提示,直接退出,一头雾水。
此问题的可能性有:
1)deplo.prototxt 中shape的数据维数与训练数据维数(第一维可以不同)不同。
layer {
name: “data”
type: “Input”
top: “data”
input_param { shape: { dim: 1 dim: 3 dim: 28 dim: 28 } } // {batch,chanel,w,h}
}

2)deplo.prototxt 中的网络结构与训练的网络结构不相同。

0 0
原创粉丝点击