LaurentMazare / ocaml-torch

OCaml bindings for PyTorch
Apache License 2.0
410 stars 38 forks source link

Is it possible to download pretrained model weights from the python version of pytorch and use it in ocaml-torch? #62

Closed ArulselvanMadhavan closed 1 year ago

ArulselvanMadhavan commented 1 year ago

Currently, I am trying to load pretrained weights from mini-dalle using the ocaml-torch library. The examples seem to do a jit trace and save the entire model architecture with weights and load them. Is there an example where the library uses the ".pt" file saved by the pytorch and loads it into an equivalent ocaml torch model architecture?

LaurentMazare commented 1 year ago

It should be possible to run jit traced model that use the .pt format via ocaml-torch, this example shows how to do this on some CV model. Some kind of model inputs may not be supported at the moment though but they should be reasonably easy to add.

ArulselvanMadhavan commented 1 year ago

Thank you! I will try this. I missed this example