I saved a pytorch model using onnx, following the instructions shown here
Now I would like to load this model in C++. I’ve spent a whole day googling and trying out different things without any luck.
I’ve tried CAFFE_ENFORCE(ReadProtoFromFile(path, &init_net));
, where path
is a std::string pointing to the onnx file, but this throws an error which I assume is because ReadProtoFromFile
is expecting path to a protobuf file.
Ideally I would like to get the init_net
and run_net
set and use the Predictor
API for inference. If someone could give me a pointer, that’d be great.
Any help is highly appreciated. Help!