I looked more into the details of this problem and looks like I was saving-loading it correctly. The problem is that after loading the model net.blobs will not have any value. But if you use the loaded model with any test example, it works fine (as expected). I am attaching an example code, inspired from https://github.com/Russell91/apollocaffe/blob/master/examples/apollocaffe/simple.py here which works fine:
import apollocaffe
from apollocaffe.layers import NumpyData, Convolution, EuclideanLoss
import numpy as np
def save():
net = apollocaffe.ApolloNet()
for i in range(1000):
example = np.array(np.random.random()).reshape((1, 1, 1, 1))
net.clear_forward()
net.f(NumpyData('data', example))
net.f(NumpyData('label', example*3))
net.f(Convolution('conv', (1,1), 1, bottoms=['data']))
net.f(EuclideanLoss('loss', bottoms=['conv', 'label']))
net.backward()
net.update(lr=0.1)
if i % 100 == 0:
print net.loss
net.save("model.h5")
def load():
print "LOAD"
net = apollocaffe.ApolloNet()
net.load("model.h5")
#example = np.array(np.random.random()).reshape((1, 1, 1, 1))
example = np.asarray([[[[ 0.92890837]]]])
net.clear_forward()
net.f(NumpyData('data', example))
net.f(NumpyData('label', example*3))
net.f(Convolution('conv', (1,1), 1, bottoms=['data']))
net.f(EuclideanLoss('loss', bottoms=['conv', 'label']))
net.backward()
net.update(lr=0.1)
print net.loss
save()
load()