aiqm / torchani

Accurate Neural Network Potential on PyTorch
https://aiqm.github.io/torchani/
MIT License
460 stars 127 forks source link

Unable to export neural network #551

Closed tengjieksee closed 3 years ago

tengjieksee commented 3 years ago

Hi everyone, I just wanna ask how do I export the neural network into the format like the ani-1x_8x model as shown in the fig below?

anipic

(https://github.com/aiqm/ani-model-zoo/tree/master/resources/ani-1x_8x)

So far, I managed to run the nnp_training.ipnyb (https://aiqm.github.io/torchani/examples/nnp_training.html) example and I managed to get the checkpoint file of the neural network but I couldn't find any way to export the network into that format.

Any help would be appreciated.

yueyericardo commented 3 years ago

Hi, the one you are saying is or internal neurochem format, you don’t need to save as this format. Refer to this page https://aiqm.github.io/torchani/examples/nnp_training.html, about how to use torch.save() save your model.

IgnacioJPickering commented 3 years ago

@tengjieksee neurochem format is essentially deprecated and we only use it for legacy reasons. There may be networks trained in the future using neurochem format that will be provided with torchani, but the idea is not for users to save in this format since it serves no real purpose. I recommend you use either torch.save() or you save the parameter dict of your models https://pytorch.org/tutorials/beginner/saving_loading_models.html That may be useful

tengjieksee commented 3 years ago

Are there any ways to create the neurochem format even though it is depreciated?

zasdfgbnm commented 3 years ago

Hi @tengjieksee I don't think we have time to implement a writer for NeuroChem format. If you are really interested, you can reverse engineer the loader code and write a converter based on that.