caffe matlab matcaffe 加载输入网络net时报错

来源:互联网 发布:java 反射调用set方法 编辑:程序博客网 时间:2024/05/19 14:37

如题,报错信息如下:

Warning: The following error was caught while executing 'caffe.Net' class destructor:
Error using caffe_
Usage: caffe_('delete_solver', hNet)

Error in caffe.Net/delete (line 72)
      caffe_('delete_net', self.hNet_self);


报错原因:旧一点版本的caffe的matlab接口中的函数Net.m源程序有bug。

When constructing a network, the internal object initialization of Matlab actually creates a new network and replaces the already instantiated object, causing an empty network to be deleted. This PR checks if the caffe net pointer is defined before calling the net-deletion-function in caffe_.cpp.  ( 取自https://github.com/BVLC/caffe/pull/5588

修复方法:重新安装新版本的caffe,或者进入目录,在对应的函数处进行修改:

    function delete (self)   %caffe重新建立网络时会自动删除之前建立的网络
      if self.isvalid  (或者~isempty(self.hNet_self))
      caffe_('delete_net', self.hNet_self);
      end
    end

阅读全文
0 0
原创粉丝点击