Skip to content

Instantly share code, notes, and snippets.

@persiyanov
Created November 29, 2016 12:07
Show Gist options
  • Save persiyanov/ed7a21c7f82713c33d11eaf8428c4d56 to your computer and use it in GitHub Desktop.
Save persiyanov/ed7a21c7f82713c33d11eaf8428c4d56 to your computer and use it in GitHub Desktop.
load/save weights in lasagne network
# Optionally, you could now dump the network weights to a file like this:
np.savez('model.npz', *lasagne.layers.get_all_param_values(network))
#
# And load them again later on like this:
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment