I trained a model with Tensorflow 2.0 and want to use it with the C API.
I know my implementation of the C API is right since other (old) PB files (I downloaded) seems to work fine.
But the pb file generated with those commands does not work:
model.save("./model")
#or
tf.saved_model.save(model, "./model")
I get an "Invalid GraphDef" status whenever I try to load it with the C API with
TF_Buffer* GraphDefinition = ReadBufferFromFile("./model/saved_model.pb");
[...]
TF_GraphImportGraphDef(Graph, GraphDefinition, GraphDefOptions, Status);
I tried the freeze_graph thing, but that does not seem to work on TF 2.0... And a bunch of resources are outdated concerning this question. I assume the PB files generated by TF 2.0 may not be the same format as the ones generated by TF 1.x?
So what are my options to run this model on a C/C++ environment?
(I prefer not to compile things with bazel and stuff, the C API DLL is pretty convenient in my case)