wooden-dusk-90720
01/27/2023, 4:39 PMself? I'm getting an error about "weakly-referenced object no longer exists", which I believe is coming from my pytorch model. I'm also not directly creating any weakly referenced objects in my code (to the best of my knowledge anyway)
2023-01-27T03:45:37.502-08:00 File "/metaflow/metaflow/datastore/task_datastore.py", line 282, in pickle_iter
2023-01-27T03:45:37.502-08:00 blob = pickle.dumps(obj, protocol=2)
2023-01-27T03:45:37.502-08:00 ReferenceError: weakly-referenced object no longer existsancient-application-36103
01/28/2023, 1:20 AMwooden-dusk-90720
01/28/2023, 1:21 AMvictorious-lawyer-58417
01/28/2023, 1:21 AMpytorch models serialize fine (see e.g. this example). It's a complex project though so it might be something specific to your projectvictorious-lawyer-58417
01/28/2023, 1:24 AMdill is pretty magical - sometimes it appears to work but the results can be unexpected. If you want a more robust method, using the native serialization method of the modeling library is usually the best bet
For instance here's an example for Keras - then you can do
self.model = save_model(my_model)
and
my_model = load_model(self.model)colossal-jewelry-36870
02/07/2023, 1:55 PM.tune() from PyTorch Lightning more precisely