Closed kjancsi closed 9 years ago
check out pickle. https://docs.python.org/2/library/pickle.html
Thanks. I tried pickle'ing the model object in tutorial.py after it has been trained, but that did not work.
Looking into this, on the same device (cpu or gpu) pickle/joblib should work but almost certainly won't across devices. We are planning an explicit save interface to take care of all the edge cases to make sure this just works.
@kjancsi Just wanted to give a status update from the sidelines. Looks like Alec has figured out what the issue is, and is just working on a couple slightly painful implementation details here.
@Newmu Something this week?
Load and save functions are now added to passage.utils. Example usage in readme.
Let me know if you have any issues - supports cross device, so you can train on a GPU and predict on a CPU and vice-versa.
Thanks for implementing this feature. I've noticed an issue when using OneHot input representation.
Traceback (most recent call last):
File "....py", line 98, in <module>
model = load('save_test.pkl') # How to load
File "/.../Passage/passage/utils.py", line 44, in load
model['config']['layers'] = [getattr(layers, layer['layer'])(**layer['config']) for layer in model['config']['layers']]
TypeError: __init__() got an unexpected keyword argument 'weights'
Thanks! Weights is used to set parameters when loading a model and forgot the onehot layer doesn't have any! Quick fix pushed.
Thanks, it works now.
Hi, is there any way to save/load trained models? Thanks.