summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalte Stær Nissen <nissen@di.ku.dk>2017-05-04 14:33:40 +0200
committerMalte Stær Nissen <nissen@di.ku.dk>2017-05-04 14:36:58 +0200
commitec35395e131a0d5e7c55cbd74dadbd46a49a645c (patch)
treeaf14b8a6a26018a8e80a5a75fa945c74b19fcd39
parenteeebdab16155d34ff8f5f42137da7df4d1c7eab0 (diff)
downloadcaffe-ec35395e131a0d5e7c55cbd74dadbd46a49a645c.tar.gz
caffe-ec35395e131a0d5e7c55cbd74dadbd46a49a645c.tar.bz2
caffe-ec35395e131a0d5e7c55cbd74dadbd46a49a645c.zip
Handling destruction of empty Net objects
-rw-r--r--matlab/+caffe/Net.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/matlab/+caffe/Net.m b/matlab/+caffe/Net.m
index 349e060e..bb99ec89 100644
--- a/matlab/+caffe/Net.m
+++ b/matlab/+caffe/Net.m
@@ -69,7 +69,9 @@ classdef Net < handle
self.blob_names = self.attributes.blob_names;
end
function delete (self)
- caffe_('delete_net', self.hNet_self);
+ if ~isempty(self.hNet_self)
+ caffe_('delete_net', self.hNet_self);
+ end
end
function layer = layers(self, layer_name)
CHECK(ischar(layer_name), 'layer_name must be a string');