0

I have trained a model that denoises results of realistic rendering in python.

In python, the graph is constructed dynamically in conjunction with the image size by converting the image to tf.constant.

Now I want to export the model and load it in C++.

My question is: Is it possible to process images of different sizes in Tensorflow C++ API?

If not, what's the possible best way to do this in C++? Use cuDNN directly and load the trained CNN kernel weights?

chaosink
  • 1,329
  • 13
  • 27

1 Answers1

1

So the answer is: yes, you can process images of different sizes.

The default way is to construct the TensorFlow graph in Python using tf.placeholder with unknown dimensions [B, None, None, 3] and then simply import the graph in C++. This has been previously discussed here: https://stackoverflow.com/a/48893889/7443104 which includes an example für C, C++, Golang.

In TensorFlow most ops do not care about the specific input size, see https://stackoverflow.com/a/48558479/7443104 for more details.

Patwie
  • 4,360
  • 1
  • 21
  • 41