0

I am trying to save my output parameters so I can continue training/ classifying at a later date.

I am currently using:

np.savez('model.npz', *lasagne.layers.get_all_param_values(network))

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(network, param_values)

as suggested here. But despite importing get_all_param_values from lasagne, I keep getting the error:

AttributeError: 'TensorVariable' object has no attribute 'get_params'

The layer I'm trying to save is:

    train_out = lasagne.layers.get_output(output, {input_var:x1, input2_var:x2, 
input3_var:x3}, deterministic=False)

Am I doing something wrong?

JP1
  • 731
  • 1
  • 10
  • 27

1 Answers1

0

Assuming that

output

in your above code is your actual output layer, you should pass this layer to

get_all_params(...)

Passing

train_out

to it won't work, since the result of

get_params(...)

is a theano TensorVariable (as stated in the error message), not a lasagne.Layer object.

s1hofmann
  • 1,491
  • 1
  • 11
  • 22
  • it was a silly coding error, as you said output was my output not train out, all fixed, thanks! PS. should I remove the questions if i figure out the problem myself? – JP1 Jun 03 '16 at 08:11
  • I'm not sure. If you figured it out yourself, maybe post the solution just in case someone else runs into the same problem? – s1hofmann Jun 03 '16 at 08:14