dtamayo / spock

🖖 A package to determine whether planetary orbital configurations will live long and prosper
GNU General Public License v3.0
64 stars 15 forks source link

Remove PyTorch Lightning dependency #27

Closed MilesCranmer closed 5 months ago

MilesCranmer commented 5 months ago

Also I made the README example of deep regressor a bit better.

dtamayo commented 5 months ago

Awesome...we were also running into trouble with pickled model files with Caleb. Pytorch seemed to suggest this to avoid pickling:

https://pytorch.org/tutorials/beginner/saving_loading_models.html#saving-loading-model-for-inference

Safetensors is more robust?

MilesCranmer commented 5 months ago

Yeah safetensors is pretty much all that they recommend there, plus additional stuff to make it even safer (since pickle allows arbitrary code execution).

Also don't merge this yet; trying to fix some issues...

dtamayo commented 5 months ago

If you figure it out, could you tell Caleb how you did it so we can save his models your way? With pickle it also causes problems being loaded in a different module from the one in which it was saved.

MilesCranmer commented 5 months ago

What is his branch?

dtamayo commented 5 months ago

working on the caleb branch

MilesCranmer commented 5 months ago

Thanks!

Okay I think this PR is ready for review. I also removed the pandas and matplotlib dependency for good measure.

MilesCranmer commented 5 months ago

Re: Caleb's branch, I don't see data for the model stored anywhere (?)

Also is there a test to try it out on for debugging?

dtamayo commented 5 months ago

Thanks so much Miles. Will merge these changes into the caleb branch and add a test