0

for normal saving and loading pytorch model is quite simple.

in python I can use torch.save(model, FilePath) and in c++torch::jit::load(FilePath). and the saved model and c++ load code can be placed in one directory. However, there is a limitation that binary file cannot be contained in the directory in the production mode (Please don't ask me why the binary file cannot be contained, I also wondering).

So, I want to know how to save the pytorch model from python without serializtion and load this model in c++. Is it possible?

zmwang
  • 519
  • 1
  • 7
  • 13

1 Answers1

0

Use the ONNX file format. Pytorch can output files in this format, and then you should be able to find a related library to load this in C++.

DerekG
  • 3,555
  • 1
  • 11
  • 21