-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving general artifacts #153
Comments
Hi @kfir99, This is very interesting use case, could you elaborate on how it is used ? |
I'll elaborate: |
@kfir99 , let me see if I understand you correctly
Regarding (1) you could do: import pickle
with open('temp_object.pkl', 'wb') as f:
pickle.dump(my_object, f)
task.upload_artifact('classification_network', artifact_object='temp_object.pkl', delete_after_upload=True) Regrading (2), you can manually upload a model file (which will be automatically connected with the experiment) : from trains import OutputModel
OutputModel(framework='mxnet').update_weights('mxmodel.bin') What do you think? EDIT: task.upload_model('my object', my_object, auto_pickle=True) Then from another script we could do the following that will automatically load the object from the pickle file: previous_task = Task.get_task(task_id='abcq123')
my_object = previous_task.artifacts['my object'].get() It actually sounds like a cool feature to add :) |
Thanks for your response! |
@kfir99 , awesome we are in agreement, we will add this feature 🚀
Notice that (1) passes a string (or a Path object) , My guess is that you passed a link to a file that was not there (or maybe it was a relative path etc). from pathlib2 import Path
import pickle
with open('temp_object.pkl', 'wb') as f:
pickle.dump(my_object, f)
pickle_file = Path('temp_object.pkl')
assert pickle_file.exists()
task.upload_artifact('classification_network', artifact_object=pickle_file, delete_after_upload=True) |
Changing the path from a string to a Path object worked :) |
Fix multiple argparse calls before task.init Add mark_started force argument #159
Hi @kfir99 task.upload_artifact('MyObject', artifact_object=object() auto_pickle=True)
# and later from another process
my_object = task.artifacts['MyObject'].get() Install the latest RC to enjoy the new feature pip install trains==0.15.2rc0 |
Thank you very much, I'm excited to try it out! |
Hi,
I'd like to save an object of a class I implemented as an artifact.
According to the documentation, it seems like something I am supposed to be able to do, but when I try I get an error:
"Artifact type <my_class> not supported" :(
Any ideas?
Thanks!
The text was updated successfully, but these errors were encountered: