0
votes

I would like to train tensorflow models with the python API but use the trained graphs for inference in Matlab. I searched for possibilities to do this, but I can't seem to figure it out.

Does anybody have a good idea how to do this? Do I have to compile the model with bazel? Do I do it with tensorflow serving? Do I load the metagraph in a C++ function that I include in Matlab?

Please keep in mind that I'm an enigeer and don't have extensive programming knowledge :)

1
Matlab is pretty well integrated with Java so you could call TF from Matlab using TF Java APIYaroslav Bulatov
I would be more comfortable with C++, so I would load a graph in the C++ API that I saved in the Python API?Torben

1 Answers

0
votes

In case someone lands here with a similar question, I'd like to suggest tensorflow.m - a Matlab package I am currently writing (available on GitHub). Although still in development, simple functionality like importing a frozen graph and running an inference is already possible (see the examples) - I believe this is what you were looking for?

The advantage is that you don't need any expensive toolbox nor a Python/Tensorflow installation on your machine. I'd be glad if the package can be of use for someone looking for similar solutions; even more so, in case you extend/implement something and open a PR.