with np.load('model.npz') as f:
param_values = [f['arr_%d' % i] for i in range(len(f.files))]
lasagne.layers.set_all_param_values(output, param_values)
Where output is:
output = lasagne.layers.DenseLayer(l_dropout, num_units=3, nonlinearity = lasagne.nonlinearities.softmax)
I manage to save the parameters into model.npz, however upon loading, i seem to get the error:
ValueError: mismatch: got 1 values to set 14 parameters
Perhaps of note is that 14 is the number of layers I have. does this mean I need to save and load the parameters for each layer? Or i am doing something wrong?
Best,
Joe
def load_model():
with np.load("model.npz") as f:
param_values = [f['arr_%d' % i] for i in range(len(f.files))]
return param_values[0]